| 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.iniis 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_ENVInputHandleThis is the input handle in whose context the new handle will be allocated. IfHandleTypeisSQL_HANDLE_ENV, this isSQL_NULL_HANDLE. For
	  a handle of typeSQL_HANDLE_DBC, this has to be an environment handle, and 
	  if it isSQL_HANDLE_STMTorSQL_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,orSQL_ERROR. | ||||||||||||||||||||||||||||||||
|   | SQLBindCol | |||||||||||||||||||||||||||||||
|   | binds a variable to a column in the result. ArgumentsStatementHandleStatementHandlemust have been allocated bySQLAllocHandleand 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 bufferTargetValuePtrpoints at in bytes.StrLen_or_IndPtrWhen data is fetched, returns either
 ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERRORorSQL_INVALID_HANDLE. | |||||||||||||||||||||||||||||||
|   | SQLConnect | |||||||||||||||||||||||||||||||
|   | connects to a datasource ArgumentsConnectionHandleConnectionHandlemust have been allocated bySQLAllocHandleand will hold all information about the connection.ServerNameName of the database serverNameLength1The length ofServerNameorSQL_NTSUserNameThe name of the user who connects to the database.NameLength2The length ofUserNameorSQL_NTSAuthenticationPassword of the userNameLength3The length ofAuthenticationorSQL_NTSReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERRORorSQL_INVALID_HANDLE. | |||||||||||||||||||||||||||||||
|   | SQLDataSources | |||||||||||||||||||||||||||||||
|   | fetches available datasource names either user, system or both. ArgumentsEnvironmentHandleEnvironmentHandlemust have been allocated bySQLAllocHandle.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 bufferTargetValuePtrpoints 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>orSQL_INVALID_HANDLE. | |||||||||||||||||||||||||||||||
|   | SQLExecDirect | |||||||||||||||||||||||||||||||
|   | Executes a SQL statement ArgumentsStatementHandleStatementHandlemust have been allocated bySQLAllocHandleand will hold all information and the result set of the statement.StatementTextThe SQL statement to be executedTextLengthThe length ofStatementTextorSQL_NTSReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERRORorSQL_INVALID_HANDLE. | |||||||||||||||||||||||||||||||
|   | SQLDisconnect | |||||||||||||||||||||||||||||||
| disconnects the specified connection ArgumentsConnectionHandleThe handle of the connection to be closed.ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE,orSQL_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_ENVInputHandleThe handle to be freed. Should match the type stated byHandleTypeReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE,orSQL_ERROR. | ||||||||||||||||||||||||||||||||
|   | SQLNumResultCols | |||||||||||||||||||||||||||||||
| returns the number of columns in the result set. ArgumentsStatementHandleStatementHandlemust have been allocated bySQLAllocHandleand 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. ArgumentsStatementHandleStatementHandlemust have been allocated bySQLAllocHandleand 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. ArgumentsConnectionHandleConnectionHandlemust have been allocated bySQLAllocHandleand defines the connection which will be modified.Attributewhich attribute to setValuePtrPointer to the value forAttribute. Depending onAttribute,ValuePtrwill be a 32-bit integer 
   value or a pointer to a null-terminated string.StringLengthIfValuePtrpoints to a character string or a binary buffer, this 
   argument should be the length of*ValuePtr.
   Otherwise, forValuePtrof type integerStringLengthis ignored.Returns
 | |||||||||||||||||||||||||||||||
|   | SQLSetEnvAttr | |||||||||||||||||||||||||||||||
|   | sets attributes of environments. ArgumentsEnvironmentHandleEnvironmentHandlemust have been allocated bySQLAllocHandleAttributewhich attribute to setValuePtrPointer to the value forAttribute. Depending onAttribute,ValuePtrwill be a 32-bit integer 
   value or a pointer to a null-terminated string.StringLengthIfValuePtrpoints to a character string or a binary buffer, this 
   argument should be the length of*ValuePtr.
   Otherwise, forValuePtrof type integerStringLengthis ignored.ReturnsSQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERRORorSQL_INVALID_HANDLE. | |||||||||||||||||||||||||||||||