Index / Glossary | ||||||||||||||||||||||||||||
|
C |   | Column | ||||||||||||||||||||||||||||||
A column is another name for field in a SQL table. It has a data type (Integer, Char, Money etc) and a name by which it is addressed. You specify the name of a column in a query (either DELETE, UPDATE, SELECT or INSERT) |
||||||||||||||||||||||||||||||||
D |   | data source | ||||||||||||||||||||||||||||||
A data source defines all informationen needed by ODBC to connect to a database. This includes the name of the driver to use (Postgres, mySQL etc.), the name of the user, his password, the server name on which the database resides and of course the name of the database. There are a lot more options available. | ||||||||||||||||||||||||||||||||
  | Data Types | |||||||||||||||||||||||||||||||
The following table show some ODBC data types and how the relate to standard C data types:
You will need the type identifier in calls to SQLBindCol. |
||||||||||||||||||||||||||||||||
  | ||||||||||||||||||||||||||||||||
O |   | odbc.ini | ||||||||||||||||||||||||||||||
/etc/odbc.ini is the configuration file for system
data sources. It contains information which will be needed when
connecting to a database. It is modified by a graphical utility
ODBCConfig.
|
||||||||||||||||||||||||||||||||
R |   | Row | ||||||||||||||||||||||||||||||
A row is a set of columns in a query. For example in our table there are two users. Each user makes up a row in the table or in the result of our query. | ||||||||||||||||||||||||||||||||
S |   | SQLAllocHandle | ||||||||||||||||||||||||||||||
allocates needed handles.
ArgumentsHandleType
Defines the type of handle to be allocated by
SQL_HANDLE_ENV
InputHandleThis is the input handle in whose context the new handle will be allocated. IfHandleType is SQL_HANDLE_ENV , this is SQL_NULL_HANDLE . For
a handle of type SQL_HANDLE_DBC , this has to be an environment handle, and
if it is SQL_HANDLE_STMT or SQL_HANDLE_DESC , it must be a connection
handle.
OutputHandlePtrPointer to a buffer in which to return the allocated handle.ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, or SQL_ERROR .
|
||||||||||||||||||||||||||||||||
  | SQLBindCol | |||||||||||||||||||||||||||||||
  |
binds a variable to a column in the result.
ArgumentsStatementHandleStatementHandle must have been allocated by SQLAllocHandle
and will hold all information and the result set of the statement.
ColumnNumberNumber of the column in the result set. Starts with 1.TargetTypeType identifier of the data typeTargetValuePtrThe pointer to the variable in which the data will be stored.BufferLengthThe size of the bufferTargetValuePtr points at in bytes.
StrLen_or_IndPtrWhen data is fetched, returns either
ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE .
|
|||||||||||||||||||||||||||||||
  | SQLConnect | |||||||||||||||||||||||||||||||
  |
connects to a datasource
ArgumentsConnectionHandleConnectionHandle must have been allocated by SQLAllocHandle
and will hold all information about the connection.
ServerNameName of the database serverNameLength1The length ofServerName or SQL_NTS
UserNameThe name of the user who connects to the database.NameLength2The length ofUserName or SQL_NTS
AuthenticationPassword of the userNameLength3The length ofAuthentication or SQL_NTS
ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE .
|
|||||||||||||||||||||||||||||||
  | SQLDataSources | |||||||||||||||||||||||||||||||
  |
fetches avaible datasource names either user, system or both.
ArgumentsEnvironmentHandleEnvironmentHandle must have been allocated by SQLAllocHandle .
DirectionWhich DSN we are looking for. May be on of:
ServerNameThe name of the datasource is returned herein.BufferLength1Defines how many chars Servername may contain at most.NameLength1PtrThe pointer to the variable in which the actual length of the datasource name is stored. If NameLength1Ptr is greater than BufferLength1, then the DSN in ServerName is truncated to fit.BufferLengthThe size of the bufferTargetValuePtr points at in bytes.
DescriptionThe description supplied with the datasource, giving more information on the datasource in human readable form.BufferLength2Defines how many chars Description may contain at most.NameLength2PtrThe pointer to the variable in which the actual length of the description is stored. If NameLength2Ptr is greater than BufferLength2, then the description in Description is truncated to fit.ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR , SQL_NO_DATA> or SQL_INVALID_HANDLE .
|
|||||||||||||||||||||||||||||||
  | SQLExecDirect | |||||||||||||||||||||||||||||||
  |
Executes a SQL statement
ArgumentsStatementHandleStatementHandle must have been allocated by SQLAllocHandle
and will hold all information and the result set of the statement.
StatementTextThe SQL statement to be executedTextLengthThe length ofStatementText or SQL_NTS
ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE .
|
|||||||||||||||||||||||||||||||
  | SQLDisconnect | |||||||||||||||||||||||||||||||
disconnects the specified connection
ArgumentsConnectionHandleThe handle of the connection to be closed.ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, or SQL_ERROR .
|
||||||||||||||||||||||||||||||||
  | SQLFetch | |||||||||||||||||||||||||||||||
Fetches the next row of the result set.
ArgumentsStatementHandleThe handle of the statement to be closed fromwhich the data should be fetched.Returns
|
||||||||||||||||||||||||||||||||
  | SQLFreeHandle | |||||||||||||||||||||||||||||||
frees allocated handles.
ArgumentsHandleTypeDefines the type of handle to be freed. There are four possible values:
SQL_HANDLE_ENV
InputHandleThe handle to be freed. Should match the type stated byHandleType
ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, or SQL_ERROR .
|
||||||||||||||||||||||||||||||||
  | SQLNumResultCols | |||||||||||||||||||||||||||||||
returns the number of columns in the result set.
ArgumentsStatementHandleStatementHandle must have been allocated by SQLAllocHandle
and holds all information and the result set of the statement.
ColumnCountPtrA pointer to a variable to hold the result value.Returns
|
||||||||||||||||||||||||||||||||
  | SQLRowCount | |||||||||||||||||||||||||||||||
returns the number of rows affected by INSERT, UPDATE or DELETE.
Many drivers (but not all) return the number of rows returned by the
last executed SELECT statement too.
ArgumentsStatementHandleStatementHandle must have been allocated by SQLAllocHandle
and holds all information and the result set of the statement.
RowCountPtrA pointer to a variable to hold the result value.Returns
|
||||||||||||||||||||||||||||||||
  | SQLSetConnectAttr | |||||||||||||||||||||||||||||||
  |
modifies attributes of connections.
ArgumentsConnectionHandleConnectionHandle must have been allocated by SQLAllocHandle
and defines the connection which will be modified.
Attributewhich attribute to setValuePtrPointer to the value forAttribute . Depending on
Attribute , ValuePtr will be a 32-bit integer
value or a pointer to a null-terminated string.
StringLengthIfValuePtr points to a character string or a binary buffer, this
argument should be the length of *ValuePtr .
Otherwise, for ValuePtr of type integer StringLength is ignored.
Returns
|
|||||||||||||||||||||||||||||||
  | SQLSetEnvAttr | |||||||||||||||||||||||||||||||
  |
sets attributes of environments.
ArgumentsEnvironmentHandleEnvironmentHandle must have been allocated by SQLAllocHandle
Attributewhich attribute to setValuePtrPointer to the value forAttribute . Depending on
Attribute , ValuePtr will be a 32-bit integer
value or a pointer to a null-terminated string.
StringLengthIfValuePtr points to a character string or a binary buffer, this
argument should be the length of *ValuePtr .
Otherwise, for ValuePtr of type integer StringLength is ignored.
ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE .
|