odbc_env_open(
-EnvHandle)
odbc_db_open(
+Dbname,
+EnvHandle,
-ConnectionHandle)
odbc_db_open(
+Dbname,
+EnvHandle,
+Options,
-ConnectionHandle)
username(
+Username)
''
.
password(
+Password)
''
.
login_timeout(
+Timeout)
connection_timeout(
+Timeout)
raw(
+ConnectionOptions)
odbc_db_open(
+Dbname,
+EnvHandle,
+Options,
-ConnectionHandle,
-ConnectionString)
odbc_db_open/4
but also returns the completed connection string
returned by the ODBC driver.
odbc_query_open(
+ConnectionHandle,
-StatementHandle)
odbc_db_open/[3,4,5]
.
odbc_list_DSN(
+EnvHandle,
-DSNs)
odbc_list_data_types(
+StatementHandle,
+TableDesc,
-DataTypes)
odbc_query_open/2
.
TableDesc is a description of the table and its columns of the form
tablename(columnname1, columnname2, ..., columnnameN)
, or of the form
[tablename, columnname1, columnname2, ..., columnnameN]
(the latter
form is useful if the table has more than 255 columns).
DataTypes is unified with a list of the corresponding datatypes, i.e.
on the form [datatype1, datatype2, ... datatypeN]
.
odbc_current_table(+ConnectionHandle, ?TableName)
'TABLE_TYPE'("TABLE")
.
ConnectionHandle is a handle previously allocated with odbc_db_open/[3,4,5]
.
TableName is the name, as an atom, of the table.
Note that odbc_current_table/2
may exit nondeterminately
even if all arguments are instantiated when it is called.
odbc_current_table(+ConnectionHandle, ?TableName, ?Attribute)
ConnectionHandle is a handle previously allocated with odbc_db_open/[3,4,5]
.
TableName is the name, as an atom, of the table.
Attribute is an attribute of the table.
There are two kinds of attributes, derived attributes and raw attributes.
The derived attributes are translations of raw attributes and other information and are in a format that is directly useful. There is currently only one derived attribute,
arity(
Value)
This attribute is always present.
The raw attributes correspond direcly to the (non-null) values
returned from the ODBC function SQLTables()
and are
returned as is, wrapped in a functor with the same name as the
attribute, e.g. 'TABLE_CAT'("foo")
would be returned for a
table in the catalog "foo". Note that the names of the raw
attributes are in all uppercase so you need to surround them with
single quotes to prevent their name from being parsed as a
variable. Some of the raw attributes are,
'TABLE_CAT'(
Value)
TABLE_CAT
column, called TABLE_QUALIFIER
in ODBC 2.0, as returned from the ODBC function SQLTables()
.
'TABLE_TYPE'(
Value)
TABLE_TYPE
column, as returned from the ODBC function
SQLTables()
. The standard table types are "TABLE"
,
"VIEW"
, "SYSTEM TABLE"
, "GLOBAL TEMPORARY"
,
"LOCAL TEMPORARY"
, "ALIAS"
, and "SYNONYM"
, but
there can be data-source-specific types as well.
This attribute is always present.
'REMARKS'(
Value)
REMARKS
column, as returned from the ODBC function
SQLTables()
.
SQLTables()
for the full
list of raw attributes and their meaning.
Note that odbc_current_table/3
may exit nondeterminately
even if one of more arguments are instantiated when it is called.
odbc_table_column(+ConnectionHandle, ?TableName, ?ColumnName)
ConnectionHandle is a handle previously allocated with odbc_db_open/[3,4,5]
.
TableName is the name, as an atom, of the table.
ColumnName is the name, as an atom, of the table.
odbc_table_column(+ConnectionHandle, ?TableName, ?ColumnName, ?Attribute)
ConnectionHandle is a handle previously allocated with odbc_db_open/[3,4,5]
.
TableName is the name, as an atom, of the table.
ColumnName is the name, as an atom, of the table.
Attribute is an attribute of the table.
There are two kinds of attributes, derived attributes and raw attributes.
The derived attributes are translations of raw attributes and other information and are in a format that is directly useful. There is currently only one derived attribute,
nullable(
Value)
true
if the column is definitely nullable, or false
if the column is definitely not nullable. The value is derived
from the raw attributes NULLABLE
and IS_NULLABLE
,
see the documentation for SQLColumns()
for details.
This attribute is not present if it can not be determined whether the column is nullable.
The raw attributes correspond direcly to the (non-null) values
returned from the ODBC function SQLColumns()
and are
returned as is, wrapped in a functor with the same name as the
attribute, e.g. 'TABLE_CAT'("foo")
would be returned for a
column in a table in the catalog "foo". Note that the names of the
raw attributes are in all uppercase so you need to surround them
with single quotes to prevent their name from being parsed as a
variable. Some of the raw attributes are,
'REMARKS'(
Value)
REMARKS
column, as returned from the ODBC function
SQLColumns()
.
'ORDINAL_POSITION'(
Value)
ORDINAL_POSITION
column, as returned from the ODBC function SQLColumns()
.
This attribute is always present.
See the ODBC documentation for SQLColumns()
for the full
list of raw attributes and their meaning.
Note that odbc_table_column/4
may exit nondeterminately
even if one of more arguments are instantiated when it is called.
odbc_query_execute_sql(
+StatementHandle,
+SQLString,
+ParamData,
+ParamDataTypes,
-ResultSet)
odbc_query_open/2
.
SQLString is the SQL statement to be executed. The statement string may
contain parameter markers.
ParamData is a list of data to be bound to the parameter markers.
ParamDataTypes is a list of data types corresponding to the
ParamData list.
ResultSet is bound to an opaque data structure describing the result
of the query.
odbc_query_execute_sql(
+StatementHandle,
+SQLString,
-ResultSet)
odbc_query_open/2
.
SQLString is the SQL statement to be executed.
ResultSet is bound to an opaque data structure describing the result
of the query.
odbc_sql_fetch(
+ResultSet,
-Row)
odbc_query_execute_sql/[3,5]
.
Row is unified with a non-empty list of data constituting a row in the result set,
or with []
when there are no more rows.
The elements in the Row are in the same order as in the corresponding query.
odbc_query_close(
+Query)
odbc_query_execute_sql/[3,5]
,
or it can be a statement handle, as returned from
odbc_query_open/2
.
odbc_db_close(
+ConnectionHandle)
odbc_env_close(
+EnvHandle)