Raima database manager error

raima database manager error

Raima database error -6. I recently restored my computer to an earlier date and every time I try to save an estimate I get this. raima database. Editorial information provided by DB-Engines · Name, Raima Database Manager info · Description, RDBMS with a small footprint, either embedded into an application. Raima Database Manager (RDM) is an embedded c/c++ database developed for the IoT and edge market. Raima Database Manager is: Small-footprint - Cross-platform. raima database manager error 100m

1 Raima Database Manager 11.0 ODBC API Reference Guide 1

2 Trademarks Raima Database Manager (RDM ), RDM Embedded and RDM Server are trademarks of Raima Inc. and may be registered in the United States of America and/or other countries. All other names may be trademarks of their respective owners. This guide may contain links to third-party Web sites that are not under the control of Raima Inc. and Raima Inc. is not responsible for the content on any linked site. If you access a third-party Web site mentioned in this guide, raima database manager error, you do so at your own risk. Inclusion of any links does not imply Raima Inc. endorsement or acceptance of the content of those third-party sites. Contents 3 Introduction 7 Advanced Topics 23 RDM ODBC API Reference 29 Return Codes ODBC 174 ODBC C Data Types 175 Registering RDM ODBC Driver 177 Glossary 183 Index 194 2

3 Contents Contents 3 Introduction 7 Comparing the ODBC API with the Native RSQL API 7 Basic ODBC Application Steps 9 Allocating Handles 12 Environment Handle 12 Connection Handle 12 Statement Handle 12 Descriptor Handle 12 Connecting to a Data Source 14 Choosing the Connection Type 15 Setting the Data Source Name 15 Establishing a Connection 16 Executing an SQL Statement 18 Allocating a Statement Handle 18 Preparing an SQL Statement 18 Executing an SQL Statement 18 Committing or Rolling Back Transactions 19 Retrieving the Result Set 21 Binding Columns 21 Fetching Columns 21 Advanced Topics 23 Working with Parameters 23 Fetching Multiple Rows at Once 25 Retrieving Data in Parts 27 RDM ODBC API Reference 29 SQLAllocHandle 32 SQLBindCol 34 Contents 3

4 SQLBindParameter 36 SQLCancel 38 SQLCloseCursor 40 SQLColAttribute 42 SQLColumns 45 SQLConnect 47 SQLCopyDesc 50 SQLDescribeCol 52 SQLDescribeParam 54 SQLDescribeStmt 56 SQLDisconnect 59 SQLDriverConnect 61 SQLEndTran 64 SQLExecDirect 66 SQLExecute 68 SQLExtendedTran 70 SQLFetch 74 SQLFetchScroll 76 SQLForeignKeys 78 SQLFreeHandle 80 SQLFreeStmt 82 SQLGetConnectAttr 84 SQLGetCursorName 86 SQLGetData 88 SQLGetDescField 90 SQLGetDescRec 92 SQLGetDiagField 94 SQLGetDiagRec 96 SQLGetEnvAttr 98 Contents 4

5 SQLGetFunctions 100 SQLGetInfo 102 SQLGetStmtAttr 104 SQLGetTypeInfo 106 SQLMoreResults 108 SQLNativeSql 110 SQLNumParams 112 SQLNumResultCols 114 SQLParamData 116 SQLPrepare 118 SQLPrimaryKeys 120 SQLProcedureColumns 122 SQLProcedures 124 SQLPutData 126 SQLRowCount 128 SQLSetConnectAttr 130 SQLSetCursorName 137 SQLSetDescField 139 SQLSetDescRec 141 SQLSetEnvAttr 143 SQLSetError 146 SQLSetStmtAttr 148 SQLSpecialColumns 155 SQLStatistics 158 SQLTables 160 SQLTransactStatus 162 Summary Listing of RDM SQL Server API Functions 164 rdmsqlserver_init 165 rdmsqlserver_start 168 Contents 5

6 rdmsqlserver_stop 170 rdmsqlserver_term 172 Return Codes ODBC 174 ODBC C Data Types 175 Registering RDM ODBC Driver 177 Overview 177 Opening the ODBC Driver Manager 177 Configuring the default DSN entry 178 Working with Default Databases 178 Changing the Advanced Options 179 Adding a new DSN entry 180 Removing an existing DSN entry 181 Using the ODBC Driver 182 Glossary 183 Index 194 Contents 6

7 Introduction RDM provides a separate ODBC API that allows SQL applications to be written using the industry-standard Open Data Base Connectivity C language interface to perform database operations using standard SQL. Applications written using this API can be both directly-linked to the RDM database engine or can run as client programs that access a RDM SQL server program (rdmsqlserver) running on a separate computer. Even though ODBC was developed by Microsoft for use on the Windows operating system, the RDM ODBC implementation is available on every OS platform that RDM supports. All of the functions are prefixed with "SQL". ODBC data types and constant declarations raima database manager error provided in the standard header files: sql.h for basic ODBC functionality; sqlext.h for basic and extended ODBC functionality, sqlrext.h for basic, extended, and RDM-specific functionality. The RDM ODBC implementation is based on version 3.51 of the Microsoft ODBC specification. Comparing the ODBC API with the Native RSQL API The following table provides a mapping of the ODBC API functions with the RSQL API functions. Not all ODBC raima database manager error have an equivalent RSQL API function, raima database manager error. Some, (e.g., SQLTables, raima database manager error, SQLColumns, etc) are implemented in the RDM ODBC layer as select statements on built-in virtual system catalog tables which are described later in this section. Also note that those functions that do have a RSQL API equivalent do not have the same function arguments. However, the basic operational approach (e.g., function calling sequence) that is used in an ODBC application is also needed in a RSQL application. ODBC API functions that are not listed do not have a RSQL API counterpart. Table 2. ODBC to RDM SQL API Function Mapping ODBC API Function RSQL Function Comments SQLAllocHandle rsqlallocconn rsqlallocstmt Allocation of connection and statement handles are made through separated functions. There is no environment handle. SQLBindCol n/a Column result values are not bound but are returned by rsqlfetch or rsqlgetdata. SQLBindParameter rsqlbindparam SQLCancel n/a Call rsqlclosestmt to cancel statement processing. SQLCloseCursor rsqlclosestmt SQLColAttribute rsqlgetcoldescr SQLColumns n/a Database meta-data information is available by executing select statements on the appropriate syscat virtual tables. SQLConnect n/a Connections are initiated when rsqlallocconn is called. Databases are opened through calls to rsqlopendb or rsqlopencat. SQLDescribeCol rsqlgetcoldescr SQLDescribeParam rsqlgetparamdescr SQLDescribeStmt rsqlgetstmtdescr SQLDescribeStmt is a Raima Inc. extension. SQLDisconnect n/a Connections are closed when rsqlfreeconn is called. SQLEndTran rsqltranscommit rsqltransrollback SQLExecDirect rsqlexecdirect Introduction 7

8 ODBC API Function RSQL Function Comments SQLExecute rsqlexecute SQLExtendedTran rsqltransstart rsqltranssavepoint rsqltransrelease rsqltranscommit rsqltransrollback We believe that raima database manager error calls represent a better API design than a single call with a control variable SQLFetch rsqlfetch Note that the rsqlfetch returns the column result values-no bound columns. SQLForeignKeys n/a Database meta-data information is available by executing select statements on the appropriate syscat virtual tables. SQLFreeHandle rsqlfreeconn rsqlfreestmt SQLGetConnectAttr rsqlgetautocommit rsqlgetdateformat Not all ODBC connection attributes have a RDM equivalent. Not all RDM connection attributes have an ODBC equivalent. rsqlgetdateseparator rsqlgetdeferblobmode rsqlgetreadonlytrmode SQLGetCursorName rsqlgetcursorname SQLGetData rsqlgetdata SQLMoreResults rsqlmoreresults SQLNumParams rsqlgetnumparams SQLNumResultCols rsqlgetnumresultcols SQLPrepare rsqlprepare SQLPrimaryKeys n/a Database meta-data information is available by executing select statements on the appropriate syscat virtual tables. SQLProcedures n/a Database meta-data information is available by executing select statements on the appropriate syscat virtual tables. SQLPutData rsqlputdata SQLRowCount rsqlgetrowcount SQLSetConnectAttr rsqlsetautocommit rsqlsetdateformat Not all ODBC connection attributes have a RDM equivalent. Not all RDM connection attributes have an ODBC equivalent. rsqlsetdateseparator rsqlsetdeferblobmode rsqlsetreadonlytrmode SQLSetCursorName rsqlsetcursorname SQLSetError rsqlseterrorcallback SQLSetError is a Raima Inc. extension. SQLSpecialColumns n/a Database meta-data information is available by executing select statements on the appropriate syscat virtual tables. SQLTables n/a Database meta-data information is available by executing select statements on the appropriate syscat virtual tables. SQLTransactStatus rsqltransstatus The advantage of using the native API instead of ODBC is that it is simpler and more efficient with a smaller footprint. However, ODBC is available and can certainly be used if DBMS independence and/or use of a standard SQL API is needed. Introduction 8

9 Basic ODBC Application Steps An ODBC SQL C application program consists of a set of calls to the SQL API functions in a particular sequence as outlined below. 1. Set up and initialize your application s use of the SQL API as follows. a. Call SQLAllocHandle to allocate your environment handle, which will be used in allocating your connection handle. b. Call SQLSetEnvAttr(hEnv, SQL_ATTR_ODBC_VERSION, *ODBC_VERSION,0). This will set the version of ODBC that you want to use with your database c. Call SQLAllocHandle again, but this time you are allocating your connection handle (hcon in the example below) d. Call SQLConnect to connect to the database e. Call SQLAllocHandle a third time to allocate your statement handle. You can allocate as many statement handles as you need in your application. Typically, you will need a statement handle for each statement that will be compiled once but potentially executed multiple times. f. Call SQLExecDirect("Open *database name*") in order to open your database. g. Call SQLSet* functions such as SQLSetConnectAttr to set up specific database attributes and operational parameters. 2. Prepare your application to execute SQL statements as follows. a. Call SQLPrepare to compile each of the statements that will need to be executed by your application. b. Call SQLBindParameter to bind your application s variables to any parameter markers that were specified in the SQL statements prepared in the prior step. 3. At this point your application is execution ready. That means that your application will a. Call SQLExecute to execute the appropriate statements that implement the database access needs for each particular function, raima database manager error. Alternatively you can call SQLExecDirect to both compile and execute a statement in a single call. Usually, you would only do this for statements that only need to be executed once. b. Possibly call SQLParamData and SQLPutData to process any needed data-at-exec blob parameters specified in insert and update statements. c. Call transaction statements using SQLExtendedTran in order to start the transaction, commit the transaction, create a savepoint, or rollback a transaction. d. Call SQLFetch to retrieve the result rows from an executed select statement. You may also need to call SQLGetData to retrieve blob data results a block at a time. Alternatively, if the select is updateable, you may need to call SQLGetCursorName or SQLSetCursorName associated with a related positioned update or delete statement to change the current row returned from the call to SQLFetch. You will need to call SQLFreeStmt on a select for which you do not call SQLFetch through to the end of the result set. 4. When your application is ready to terminate you raima database manager error to a. Call SQLFreeStmt or SQLFreeHandle for each statement handle allocated in step 1e. b. Call SQLFreeHandle for each allocated connection which automatically closes all open databases, terminates the connection and frees the connection handle and all its associated dynamically Introduction 9

10 allocated memory. c. Call SQLFreeHandle for your environment handle. Hello World! If you follow the basic procedure listed above you can easily create a simple database where you insert some data and the retrieve the data to be displayed back out. This can be seen with the common Hello World example. In the example below return codes are mostly ignored for simplicity. This will be ok because we know what the expected results are. /********************************************************************* ** HELLO WORLD SQL ** ** This document describes the process to create a simple database, insert a record ** containing a text field, read the text field from raima database manager error and print it out, raima database manager error. **********************************************************************/ #include <stdio.h> #include "sqlrext.h" /* The RDM SQL API.

11 World!')", SQL_NTS); /* Commit the insert, transaction is started by the first insert statement. */ SQLEndTran(SQL_HANDLE_DBC,hCon,SQL_COMMIT); /* Query the database for the record created. */ SQLExecDirect(hStmt, (SQLCHAR *) "SELECT mychar FROM info",sql_nts); /* Bind SQL fields to program variables. */ SQLBindCol(hStmt,1,SQL_C_CHAR,sz,sizeof(sz),&iLen); /* Fetch data from database into program variables. */ SQLFetch(hStmt) ; printf("%s\n\n",sz); /* Free the SQL statement handle. */ (void) SQLFreeHandle(SQL_HANDLE_STMT,hStmt); /* Close the database. */ SQLDisconnect(hCon); /*lint!e534 */ /* Free the database handles, raima database manager error. */ (void) SQLFreeHandle(SQL_HANDLE_DBC, hcon); (void) SQLFreeHandle(SQL_HANDLE_ENV, henv); return 0; } Introduction 11

12 Allocating Handles ODBC lets an application manage interactions with data sources through ODBC handles. An application tells the ODBC driver to allocate a handle by calling SQLAllocHandle. There are four types of ODBC handles. Environment Handle An environment handle is the base handle that manages global resources and options for an application. An application can call SQLAllocHandle using SQL_HANDLE_ENV as the first argument in raima database manager error to allocate an environment handle. An application must allocate an environment handle in order to access an RDM data source. Multiple environment handles can be allocated inside an application. Connection Handle A connection handle is the handle that manages resources and options specific to a connection to a data source. An application can call SQLAllocHandle using SQL_HANDLE_DBC as the first argument and an existing environment handle as the second in order to allocate a connection handle. An application must allocate a connection handle in order to access an RDM data source. An application can allocate multiple connection handles on one environment handle in order to manage multiple connections to the same or different data sources. In a multi-thread environment, RDM ODBC requires that each thread have its own connection handle. Statement Handle A statement handle is the handle that manages resources and raima database manager error specific to raima database manager error particular SQL statement operation. An application can call SQLAllocHandle using SQL_HANDLE_STMT as the first argument and an existing connection handle as the second in order to allocate a statement handle. An application must raima database manager error a statement handle in order to execute SQL statements against an RDM data source. An application can allocate multiple statement handles on one connection handle in order to execute different SQL statements on one data source. Operations such as positioned update and delete require the use of multiple statement handles on one connection. Descriptor Handle A descriptor handle is the handle that manages the detailed characteristics and information both an application and the ODBC driver use internally. There are two types of descriptors: application descriptors and implementation descriptors. An raima database manager error descriptor stores information an application maintains for its operations. An implementation descriptor stores information the ODBC driver uses internally. Both application and implementation descriptors have two subcategories: parameter descriptors and row descriptors. Together, there are four types of descriptor handles as below. Application Parameter Descriptor APD An APD maintains information about a dynamic parameter an application uses when executing an SQL statement, raima database manager error. Application Row Descriptor ARD An ARD maintains information about a row/column returned to an application when it fetches data from a data source. Introduction 12

13 Implementation Parameter Descriptor IPD An IPD maintains information about a dynamic parameter the ODBC driver uses internally when an application executes an SQL statement. Implementation Row Descriptor IRD An IRD maintains information about a row/column defined on a data source from which an application fetches data. All the four descriptors are implicitly allocated by the ODBC driver. An application can explicitly allocate application descriptors (APD and ARD) by calling SQLAllocHandle using SQL_HANDLE_DESC as the first argument and an existing connection handle as the second, and tell the ODBC drivers to use them instead of the implicitly-allocated descriptors. Descriptors explicitly allocated by an application cannot be used as implementation descriptors (IPD and IRD). The following example illustrates how to allocate ODBC handles using SQLAllocHandle. Example 1 Allocating handles #include "sqlext.h" int main(void) { SQLRETURN rc; SQLHENV henv; SQLHDBC hdbc; /* Allocate an environment handle */ rc = SQLAllocHandle(SQL_HANDLE_ENV, NULL, &henv); if (SQL_SUCCEEDED(rc)) { /* Allocate a connection handle */ rc = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc); if (SQL_SUCCEEDED(rc)) { /* Connect to the local data source. The code for connecttodatasource is shown in the next section */ rc = connecttodatasource(hdbc); if (SQL_SUCCEEDED(rc)) { /* Do some database operations */ rc = rundboperations(hdbc); } (void) SQLDisconnect(hDbc); } (void) SQLFreeHandle(SQL_HANDLE_DBC, hdbc); } (void) SQLFreeHandle(SQL_HANDLE_ENV, henv); } return 0; Introduction 13

14 Connecting to a Data Source An application will use the connection handle it allocated in order to connect to an RDM data source, by calling SQLConnect. In RDM ODBC, an RDM data source can be a transaction file server (TFServer) or a remote server process (RDMSQLServer) that accesses the TFServer. A connection to a TFServer is called "local" connection, where the RDM ODBC Driver uses the local RDM SQL engine directly linked to it in order to interact with the target TFServer, raima database manager error. A connection to an RDMSQLServer is called "remote" connection as the RDM ODBC Driver uses its remote procedure call (RPC) layer to talk to an RDMSQLServer over TCP/IP, which has its own RDM SQL engine that in turn communicates with the target TFServer. A typical RDM ODBC application is illustrated in Figure 1 below. The application will connect to the default TFS and the SQL processing will raima database manager error performed within the application process. Figure 1. Local Data Source The same RDM ODBC application can connect to an external RDM SQL engine by providing the remote connection attributes, raima database manager error. The SQL processing will be performed within the RDMSQLServer process and the results returned to the application. This client/server configuration would be used in configurations where: 1) the network speed is too slow for performing SQL engine access to the database; or, 2) the TFServer is supporting a database on a hardware architecture that is binary incompatible with the RDM ODBC API application hardware architecture (e.g., raima database manager error, database running on a PowerPC device being accessed by a remote Windows desktop). See the rdmsqlserver section for more information. Figure 2. Remote Data Source Introduction 14

15 Choosing the Connection Type An application can choose the type of connection it uses in two ways. First, it can explicitly set the connection type by setting the SQL_ATTR_RDM_CONN_TYPE connection attribute with a call to SQLSetConnectAttr before calling SQLConnect. If the application specifies SQL_CT_LOCAL, the RDM ODBC Driver will attempt to establish a local connection. If SQL_CT_REMOTE is specified, the RDM ODBC Driver will use a raima database manager error connection, raima database manager error. Alternatively, an application can let the RDM ODBC Driver choose the connection type implicitly by specifying the value for the two connection attributes: SQL_ATTR_RDM_REMOTE_NAME and SQL_ATTR_RDM_TFS_ NAME. If the SQL_ATTR_RDM_REMOTE_NAME attribute is set to a non-null, non-empty value, the RDM ODBC Driver will use a remote connection. If the SQL_ATTR_RDM_REMOTE_NAME attribute is not set or set to an empty string, and if the SQL_ATTR_RDM_ TFS_NAME attribute is set to a non-null, non-empty string, the RDM ODBC Driver will use a local connection. If neither the SQL_ATTR_RDM_REMOTE_NAME nor the SQL_ATTR_RDM_TFS_NAME attribute is set (and the connection type is not explicitly set with the SQL_ATTR_RDM_CONN_TYPE attribute), the RDM ODBC Driver will rely upon the value specified for the first argument of SQLConnect. In that case, raima database manager error, if the value is a non-null, non-empty string, the RDM ODBC Driver will use a remote connection. Otherwise, a local connection will be used. The SQL_ATTR_RDM_REMOTE_NAME and SQL_ATTR_TFS_NAME attributes are set to NULL by default. The SQL_ATTR_RDM_CONN_TYPE attribute is set to SQL_CT_UNKNOWN by default. Setting the Data Source Name In RDM ODBC, raima database manager error, a data source name is the hostname of the computer where the target TFServer (for a local connection) or the RDMSQLServer (for a remote connection) is running. If the connection type is explicitly set to remote (that is, by setting the SQL_ATTR_RDM_CONN_TYPE connection attribute to SQL_CT_REMOTE), the value stored in the SQL_ATTR_RDM_REMOTE_NAME connection attribute will be used as the data source name. If the value in the SQL_ATTR_RDM_REMOTE_NAME attribute is not set, the default name ("localhost") will be used, raima database manager error. If the connection type is explicitly set to local (that is, by setting the SQL_ATTR_RDM_CONN_TYPE connection attribute to SQL_CT_LOCAL), the value stored in the SQL_ATTR_RDM_TFS_NAME connection attribute will be used as the data source name. If the value in the SQL_ATTR_RDM_TFS_NAME attribute is raima database manager error set, the default name ("localhost") will be used. If the connection type is not explicitly set (that is, the SQL_ATTR_RDM_CONN_TYPE attribute is set to SQL_CT_ UNKNOWN), the value stored in the SQL_ATTR_RDM_REMOTE_NAME attribute will be used as the remote data source name. If the SQL_ATTR_RDM_REMOTE_NAME attribute is not set, the value stored in the SQL_ATTR_ RDM_TFS_NAME attribute will be used as the local data source name. If neither value is set, the value specified for the first argument of SQLConnect will be used as the remote data source name, raima database manager error. If that value is not set, "localhost" will be used as the local data source name. Introduction 15

16 Establishing a Connection An application calls SQLConnect to establish a connection to an RDM data source, raima database manager error. SQLConnect returns SQL_SUCCESS to let the application know a connection to the specified data source has been successfully established. SQLConnect returns SQL_ERROR when an error occurs, or SQL_SUCCESS_WITH_INFO if the operation succeeds but the RDM ODBC Driver returned diagnostic information that may include warnings. If SQLConnect returns a value other than SQL_SUCCESS, an application can call SQLGetDiagRec to retrieve the details of the diagnostics. The following examples illustrate how an application can establish a connection to a data source. Example 2 Setting a remote connection #include "sqlrext.h" /* RDM extension SQL header file */ SQLRETURN connecttodatasource( SQLHDBC hdbc) canon mp280 error code p08 SQLRETURN rc; /* Set connection type to remote */ rc = SQLSetConnectAttr(hDbc, SQL_ATTR_RDM_CONN_TYPE, (SQLPOINTER) SQL_CT_REMOTE, SQL_IS_UINTEGER); if (SQL_SUCCEEDED(rc)) { /* Since SQL_ATTR_RDM_REMOTE_NAME is not set, "localhost" will be used as the remote data source name. In this case, RDMSQLServer is running on the same computer as the application. */ rc = SQLConnect(hDbc, NULL, 0, NULL, 0, NULL, 0); } } return rc; Example 3 Using SQL_ATTR_RDM_REMOTE_NAME #include "sqlrext.h" /* RDM extension SQL header file */ SQLRETURN connecttodatasource( SQLHDBC hdbc) { SQLRETURN rc; /* This implicitly sets the connection type as local */ rc = SQLSetConnectAttr(hDbc, SQL_ATTR_RDM_TFS_NAME, (SQLPOINTER) "david-lnx", SQL_NTS); if (SQL_SUCCEEDED(rc)) { /* Since SQL_ATTR_RDM_CONN_TYPE is not set, "david-lnx" will be used as the local data source name. In this case, the TFServer is running on the computer whose hostname is "david-lnx" */ Introduction 16

17 } rc = SQLConnect(hDbc, NULL, 0, NULL, raima database manager error, 0, NULL, 0); } return rc; Example 4 Using SQLConnect #include "sqlrext.h" /* RDM extension SQL header file */ SQLRETURN connecttodatasource( SQLHDBC hdbc) { SQLRETURN rc; /* Neither SQL_ATTR_RDM_CONN_TYPE, nor SQL_ATTR_RDM_REMOTE_NAME nor SQL_ATTR_TFS_NAME is set, the driver will use the value specified in the first argument of SQLConnect to determine the connection type and data source name. In this case, "tom-mac" will be used as the remote data source name, where the RDMSQLServer is running on the computer whose hostname is "tom-mac" */ rc = SQLConnect(hDbc, (SQLCHAR *) "tom-mac", SQL_NTS, NULL, 0, NULL, 0); } return rc; An application can also establish a connection to a data source by using SQLDriverConnect. SQLDriverConnect accepts a connection string that may have the values for SQL_ATTR_RDM_REMOTE_NAME and SQL_ATTR_RDM_TFS_NAME embedded together. For details, see SQLDriverConnect in the ODBC API Function Reference section. Introduction 17

18 Executing an SQL Statement Once a connection to a data source has been established, an application can execute SQL statements to interact with the databases managed by the data source. Executing an SQL statement involves the following steps. Allocating a Statement Handle Before executing an SQL statement, raima database manager error, an application needs to allocate a statement handle by calling SQLAllocHandle, passing SQL_HANDLE_STMT to the first argument and an existing connection handle to the second. A connection to a data source must already be established on the connection handle in order to allocate a statement handle on it. Preparing an SQL Statement An application can "prepare" an SQL statement before actually executing it. Preparing an SQL statement means the RDM ODBC Driver (and its underlying RDM SQL engine) parses the statement and stores the information necessary to execute it later. This process can also detect any errors that are in the statement, such as syntax errors and references to tables/columns that do not exist. An application can prepare a statement by calling SQLPrepare. Executing an SQL Statement Once an SQL statement has been prepared, an application can call SQLExecute to perform the actual execution of the statement, raima database manager error. A prepared statement can be executed multiple times without being prepared again. This is useful when executing a statement with dynamic parameter binding. For details about dynamic parameter binding, see the Working with Parameters section. If an application needs to execute the same SQL statement only once, the preparation and execution steps can be combined into a single call to SQLExecDirect. SQLExecDirect prepares and executes the specified SQL statement at once. The following example illustrates how an application can allocate a statement handle and execute a statement that opens the NSFAWARDS database. Example 5 Opening a database #include "sqlrdm.h" SQLRETURN rundboperations( SQLHDBC hdbc) { SQLRETURN rc; SQLHSTMT hstmt; /* Allocate a statement handle */ Introduction 18

19 rc = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt); if (SQL_SUCCEEDED(rc)) { rc = SQLExecDirect(hStmt, (SQLCHAR *) "OPEN nsfawards", SQL_NTS); } (void) SQLFreeHandle(SQL_HANDLE_STMT, hstmt); } return rc; Committing or Rolling Back Transactions Statements, such as INSERT, UPDATE and Setup.exe.net framework initialization error may make changes to the data stored in the data source. Those raima database manager error are called "data manipulation language (DML) statements." When executing a DML statement, RDM ODBC automatically starts a transaction so that the changes can be committed (i.e. saved) or rolled back (i.e. aborted). Microsoft ODBC specification says transactions are committed automatically with each DML statement by default (called "autocommit"). For RDM ODBC, the "autocommit" feature is turned off by default, so an application must manually commit or roll back a transaction by calling SQLEndTran. The autocommit feature can be turned on by setting the SQL_ATTR_AUTOCOMMIT connection attribute to SQL_AUTOCOMMIT_ON. The following examples illustrate how an INSERT statement can be executed including transaction processing. It attempts to insert a new row into the PERSON table of the NSFAWARDS database. Example 6 Inserting a new row #include "sqlrdm.h" SQLRETURN rundboperations( SQLHDBC hdbc) { SQLRETURN rc; SQLHSTMT hstmt; const char *pszstmt = "INSERT INTO person VALUES " "'Houglum, Bill', 'M', raima database manager error, '1'"; /* Allocate a statement handle */ rc = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt); if (SQL_SUCCEEDED(rc)) { rc = SQLExecDirect(hStmt, (SQLCHAR *) "OPEN nsfawards", SQL_NTS); if (SQL_SUCCEEDED(rc)) { /* Execute an INSERT statement */ rc = SQLExecDirect(hStmt, (SQLCHAR *) pszstmt, SQL_NTS); if (SQL_SUCCEEDED(rc)) { /* INSERT successful; commit the change */ (void) SQLEndTran(SQL_HANDLE_DBC, hdbc, Introduction 19

20 } SQL_COMMIT); } else { /* INSERT failed; abort the change */ (void) SQLEndTran(SQL_HANDLE_DBC, hdbc, SQL_ROLLBACK); } } (void) SQLFreeHandle(SQL_HANDLE_STMT, hstmt); } return rc; Introduction 20

21 Retrieving the Result Set SQL statements can return data from the data source. Those statements that do are called "queries." Queries can be executed in the same manner as the other SQL statements. However, an application must take additional steps to retrieve the data. The data an application retrieves from the data source comes in one or more rows that in turn include one or more columns. This set of data is called "result set." Retrieving the result set involves two steps. Binding Columns First, an application should tell RDM ODBC where it wants the result set to be stored. This step is called "binding columns." An application binds a column by specifying the pointer to a variable for each returned column through a call to SQLBindCol. An application can call SQLBindCol on each of the columns for which it needs to access the returned values. Fetching Columns After binding necessary columns, an application can call SQLFetch to retrieve the result set. SQLFetch retrieves the result set one row at a time by default. An application typically calls SQLFetch repeatedly until it returns SQL_NO_DATA, which indicates the end of the result set has been reached. Each call to SQLFetch puts the values of the current result row into the variables bound to the columns by SQLBindCol. The following example illustrates how to retrieve all the rows stored in the PERSON table of the NSFAWARDS table. Example 7 Retrieving rows from PERSON #include "sqlrdm.h" SQLRETURN rundboperations( SQLHDBC hdbc) { SQLRETURN rc; SQLHSTMT hstmt; const char *pszstmt = "SELECT * FROM person"; char szname[36]; char szgender[2]; char szjob[2]; SQLLEN cb1, cb2, cb; /* Allocate a statement handle */ rc = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt); if (SQL_SUCCEEDED(rc)) { /* Open the NSFAWARDS database first */ rc = SQLExecDirect(hStmt, raima database manager error, (SQLCHAR *) "OPEN nsfawards", SQL_NTS); Introduction 21

22 if (SQL_SUCCEEDED(rc)) { /* Execute a SELECT statement */ rc = SQLExecDirect(hStmt, (SQLCHAR *) pszstmt, SQL_NTS); if (SQL_SUCCEEDED(rc)) { /* Bind all the 3 columns */ (void) SQLBindCol(hStmt 1, SQL_C_CHAR, szname, sizeof(szname), &cb1); (void) SQLBindCol(hStmt 2, SQL_C_CHAR, szgender, sizeof(szgender), &cb2); (void) SQLBindCol(hStmt 3, SQL_C_CHAR, szjob, sizeof(szjob), &cb3); do { /* Fetch as many rows as there are */ rc = SQLFetch(hStmt); if (SQL_SUCCEEDED(rc)) { if (cb1!= SQL_NULL_DATA) printf("name = %s\n", szname); if (cb2!= SQL_NULL_DATA) printf("gender = %s\n", szgender); if (cb3!= SQL_NULL_DATA) printf("jobclass = %s\n", szjob); } } while (SQL_SUCCEEDED(rc)); } /* This means fetch completed successfully */ if (rc == SQL_NO_DATA) rc = SQL_SUCCESS; } } (void) SQLFreeHandle(SQL_HANDLE_STMT, hstmt); } return rc; The last argument of SQLBindCol specifies the pointer to a variable where the ODBC drive will store the length of the returned column data. A value of SQL_NULL_DATA indicates that the returned column contains NULL. Introduction 22

23 Advanced Topics Working with Parameters Oftentimes an application needs to execute multiple SQL statements that are almost identical. For instance, an application inserting multiple rows into a table typically executes an INSERT statement differing only in the actual values to insert, as shown below. Example 8 Multiple INSERT statements INSERT INTO person VALUES 'Jackson, Michael', 'M', '1'; INSERT INTO person VALUES 'Swift, Taylor', 'F', '2'; INSERT INTO person VALUES 'Mercury, Freddie', 'F', '1'; Calling SQLExecDirect three times will get the job done, but it is not the most efficient way of handling the case as SQLExecDirect prepares and executes each statement. Since the syntax of the three statements is identical, it saves an application time if the identical portion of the statements can be prepared just once, and the insertion of different values can be executed separately. RDM ODBC provides that exact feature, called dynamic parameter binding. An application can prepare an SQL statement replacing the actual values with the symbols called parameter markers ('?'). Raima database manager error that include parameter markers are called parameterized statements, raima database manager error. Example 9 Statement with parameter markers INSERT INTO person VALUES?,?,?; An application can perform parameter binding on each of the parameter markers of a parameterized statement by calling SQLBindParameter. SQLBindParameter lets an application specify a variable to store the value that will replace the parameter marker at statement execution time. This allows an application to dynamically change the values that go with a statement after the statement has been prepared and before it has been executed. The following example inserts three rows into the PERSON table using dynamic parameter binding. Example 10 Dynamic parameter binding #include "sqlrdm.h" typedef struct person { char name[36]; char gender[2]; char jobclass[2]; } PERSON; /* Three rows to insert into the PERSON table */ static const PERSON people[] = { Advanced Topics 23

24 }; {"Jackson, Michael", "M", "1"}, {"Swift, Taylor", "F", "2"}, {"Mercury, Freddie", "M", "1"} SQLRETURN insertmultiplerows( SQLHDBC hdbc, SQLHSTMT hstmt) { SQLRETURN rc; const char *pszinsert = "INSERT INTO person VALUES?,?,?"; SQLLEN cb1, cb2, cb3; uint16_t ii; /* Assumption: hstmt has already been allocated */ /* Prepare the statement once */ rc = SQLPrepare(hStmt, (SQLCHAR *) pszinsert, SQL_NTS); if (SQL_SUCCEEDED(rc)) { /* Bind parameters for the three parameter markers */ (void) SQLBindParameter(hStmt, 1, raima database manager error, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 35, 0, szname, 0, &cb1); (void) SQLBindParameter(hStmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 1, 0, szgender, 0, &cb2); (void) SQLBindParameter(hStmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 1, 0, szjob, 0, &cb3); for (ii = 0; ii < RLEN(people); ii++) { /* Copy the values of the ii-th row into bound variables */ strcpy(szname, people[ii].name); strcpy(szgender, people[ii].gender); strcpy(szjobclass, people[ii].jobclass); cb1 = cb2 = cb3 = SQL_NTS; } /* Execute the prepared statement using the variables that are just bound to the parameters */ rc = SQLExecute(hStmt); if (!SQL_SUCCEEDED(rc)) break; } if (SQL_SUCCEEDED(rc)) SQLEndTran(SQL_HANDLE_DBC, hdbc, SQL_COMMIT); else SQLEndTran(SQL_HANDLE_DBC, hdbc, SQL_ROLLBACK); } return rc; The last argument of SQLBindParameter can be used to specify the length of the actual data bound to a parameter. For fixed data types, raima database manager error, the content of the argument is ignored. For character and binary data types, the Advanced Topics 24

25 length should be expressed in the number of bytes, or SQL_NTS if the data is a null-terminated string. SQL_ NULL_DATA should be specified to indicate that NULL will be inserted into the corresponding column. Fetching Multiple Rows at Once SQLFetch retrieves one row of the result set at a time. It can be a significant network overhead for an application accessing the data source through a remote server. To reduce network traffic, RDM ODBC provides a way to tell its driver to retrieve the specified number of rows at a time. An application can call SQLSetStmtAttr and set the SQL_ATTR_ROW_ARRAY_SIZE statement attribute to the number of rows to retrieve with a single call to Raima database manager error, as shown in Example 11. If the value of the attribute is 0 (as is by default), SQLFetch retrieves one row at a time. When an application fetches multiple rows at a time, the variable it binds to a column must be an array whose cardinality should match the number of rows to retrieve. For instance, if 10 rows are to be fetched at a time, the variable bound to an INTEGER column must be declared as "int16_t var[10]". When one call to SQLFetch returns multiple rows, the return code of SQLFetch itself cannot represent the potentially different statuses of the retrieved rows. For instance, one of the 10 rows retrieved may have its data truncated. In a situation like that, where some (but not all) returned rows contain errors or warnings, SQLFetch returns SQL_SUCCESS_WITH_INFO. An application can call SQLGetDiagRec to retrieve all the errors and warnings contained in the result set. An application can also tell the ODBC driver to store the statuses of all result rows into an array specified by the application. It can be done by setting the SQL_ATTR_ROW_STATUS_PTR statement attribute to the pointer to the array of SQLUSMALLINTs. The cardinality of the array should match the number of result rows to retrieve at once. Finally, an application can set the SQL_ATTR_ROWS_FETCHED_PTR statement attribute to the pointer to an SQLULEN variable to have the number of returned rows stored in that variable. The following example illustrates how to retrieve 10 rows at a time from the PERSON table. Example 11 Retrieving multiple rows #include "sqlrdm.h" #define ROW_ARRAY_SIZE 10 /* Fetch 10 rows at a time */ SQLRETURN rundboperations( SQLHDBC hdbc) { SQLRETURN rc; SQLHSTMT hstmt; const char *pszstmt = "SELECT * FROM person"; char szname[row_array_size][36]; char szgender[row_array_size][2]; char SQLLEN szjob[row_array_size][2]; cb1[row_array_size], cb2[row_array_size], cb3[row_array_size]; Advanced Topics 25

26 SQLULEN SQLULEN ucbfetchedrows; ii; /* Allocate a statement handle */ rc = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt); if (SQL_SUCCEEDED(rc)) { /* Open the NSFAWARDS database first */ rc = SQLExecDirect(hStmt, (SQLCHAR *) "OPEN nsfawards", SQL_NTS); if (SQL_SUCCEEDED(rc)) { /* Specify to retrieve 10 rows at a time */ (void) SQLSetStmtAttr(hStmt, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER) ROW_ARRAY_SIZE, 0); /* Specify the storage for the # of fetched rows */ (void) SQLSetStmtAttr(hStmt, SQL_ATTR_ROWS_FETCHED_PTR, raima database manager error, (SQLPOINTER) &ucbfetchedrows, 0); /* Execute a SELECT statement */ rc = SQLExecDirect(hStmt, (SQLCHAR *) pszstmt, SQL_NTS); if (SQL_SUCCEEDED(rc)) { /* Bind all the 3 columns; note that the length argument (arg. 5) is the size of one element of the bound variable */ (void) SQLBindCol(hStmt 1, SQL_C_CHAR, szname, sizeof(szname[0]), cb1); (void) SQLBindCol(hStmt 2, SQL_C_CHAR, raima database manager error, szgender, sizeof(szgender[0]), &cb2); (void) SQLBindCol(hStmt 3, SQL_C_CHAR, szjob, sizeof(szjob[0]), &cb3); while ((rc = SQLFetch(hStmt))!= SQL_NO_DATA) { /* ucbfetchedrows = # of raima database manager error */ for (ii = 0; ii < ucbfetchedrows; ii++) { if (cb1[ii]!= SQL_NULL_DATA) printf("name = %s\n", szname[ii]); if (cb2[ii]!= SQL_NULL_DATA) { printf("gender = %s\n", szgender[ii]); } if (cb3[ii]!= SQL_NULL_DATA) { printf("jobclass = %s\n", szjob[ii]); } } } } } (void) SQLFreeHandle(SQL_HANDLE_STMT, hstmt); Advanced Topics 26

27 } } return rc; With an ODBC driver that supports scrollable cursors, an application can call SQLFetchScroll to scroll the result set back and forth. The RDM ODBC Driver raima database manager error supports forward-only cursors. While it provides SQLFetchScroll, the function only accepts SQL_FETCH_NEXT as the fetch type. It means SQLFetch and SQLFetchScroll currently work the same way in RDM ODBC. Retrieving Data in Parts Binding columns using SQLBindCol allows an application to retrieve the content of a given column in one shot. It works well when the column contains fixed-length data, such as an integer, floating-point number and date/time where the size of the data is known before fetching the column, raima database manager error. On the other hand, it may not always be efficient, desired or even possible to retrieve the whole content of a column that contains string or binary data. In that case, an application can retrieve the data in parts by calling SQLGetData. SQLGetData works similarly to SQLBindCol except that SQLGetData is called after the row is fetched, not before. This allows an application to call SQLGetData on the same column multiple times in order to retrieve the column data by the size specified with the function. For instance, if an application calls SQLGet- Data with the size of data set to 100 on a column that contains a 800-character string, it will need to call the function 8 times on that column in order to read in the whole data. SQLGetData returns SQL_SUCCESS_WITH_INFO (SQLSTATE "01S02" data truncated) if there is more data to be retrieved on that column. When it has retrieved the last chunk of data, it returns SQL_SUCCESS. An application can use this mechanism to detect the last read of the data. If called after the last part of the data has been retrieved, SQLGetData returns SQL_NO_DATA. The following example illustrates how an application can retrieve a character data in parts using SQLGetData. #include "sqlrdm.h" #define MAX_FETCH_SIZE 100 SQLRETURN getchardata( SQLHSTMT hstmt) { SQLRETURN rc; char szdata[100]; /* Assumption; hstmt is already allocated */ rc = SQLExecDirect(hStmt, (SQLCHAR *) "SELECT col1 FROM vartable", SQL_NTS); if (SQL_SUCCEEDED(rc)) { while ((rc = SQLFetch(hStmt))!= SQL_NO_DATA) { do { Advanced Topics 27

28 } } rc = SQLGetData(hStmt, raima database manager error, 1, SQL_C_CHAR, raima database manager error, szdata, MAX_FETCH_SIZE, NULL); if (SQL_SUCCEEDED(rc)) printf("%s", szdata); } while (rc == SQL_SUCCESS_WITH_INFO); printf("\n"); } return rc; This mechanism can only be used to retrieve character or binary data in parts. If called on a fixed-length column more than once, SQLGetData returns SQL_NO_DATA except for the first call. Advanced Topics 28

29 RDM ODBC API Reference The topics in this section describe each ODBC function in alphabetical order. Each function is defined as a C programming language function. s include the following: Purpose Conformance Syntax Arguments Return values All of the following APIs conform to the ODBC 3.51 specification unless otherwise noted. RDM specific extensions to the APIs will be documented in the Diagnostics or Comments sections of the page. If function does not contain a Diagnostics or Comments section, the MSDN documentation applies to that specific function. Unicode API Functions The RDM ODBC API supports both ANSI and Unicode versions of all functions that accept pointers to character strings or SQLPOINTER in their arguments, raima database manager error. The Unicode functions are implemented as functions with a suffix of "W", such as SQLExecDirectW and SQLGetInfoW. Function Reference Pages This section contains topics for the following functions: Function Name SQLAllocHandle SQLBindCol SQLBindParameter SQLCancel SQLCloseCursor SQLColAttribute SQLColumns SQLConnect SQLCopyDesc SQLDescribeCol SQLDescribeParam SQLDescribeStmt SQLDisconnect SQLDriverConnect SQLEndTran Allocates an environment, raima database manager error, connection, statement, or descriptor handle Binds application data buffers to columns in the result set. Binds a buffer to a parameter marker in an SQL statement. Cancels the processing on a statement. Closes a cursor that has been opened on a statement and discards pending results. Returns descriptor information for a column in a result set, raima database manager error. Descriptor information is returned as a character string, a 32-bit descriptor-dependent value, or an integer value. Returns the list of column names in specified tables. The driver returns this information as a result set on the specified StatementHandle. Establishes connections to RDM databases via RDM ODBC. Copies descriptor information from one descriptor handle to another. Retrieves the basic result data set for a column Retrieves description of a parameter marker Retrieves the type of the SQL statement executed on the handle. Closes the connection associated with a specified handle Establishes connections to RDM databases via RDM ODBC. Accepts more connection options than SQLConnect, raima database manager error. Requests a commit or rollback for active transactions RDM ODBC API Reference 29

30 Function Name SQLExecDirect SQLExecute SQLExtendedTran SQLFetch SQLFetchScroll SQLForeignKeys SQLFreeHandle SQLFreeStmt SQLGetConnectAttr SQLGetCursorName SQLGetData SQLGetDescField SQLGetDescRec SQLGetDiagField SQLGetDiagRec SQLGetEnvAttr SQLGetFunctions SQLGetInfo SQLGetStmtAttr SQLGetTypeInfo SQLMoreResults SQLNativeSql SQLNumParams SQLNumResultCols SQLParamData SQLPrepare SQLPrimaryKeys Prepares and executes an SQL statement Executes a previously prepared SQL statement Performs a transaction operation Fetches data from a bound column to an application variable Fetches the specified rowset of data from the result set and returns data for all bound columns. SQLForeignKeys can return a list of foreign keys in the specified table (columns in the specified table that refer to primary keys in other tables) or a list of foreign keys in other tables that refer to the gameguard + error key in the specified table, raima database manager error. The driver returns each list as a result set on the specified statement. Frees resources associated with a specific environment, connection, statement, or descriptor handle. Stops processing associated with a specific statement, closes any open cursors associated with the statement, discards pending results, or, optionally, frees all resources associated with the statement handle. Returns the current setting of a connection attribute. Retrieves the cursor name of an SQL statement handle Retrieves data for a single column in the result set. It can be called multiple times to retrieve variable-length data in parts. Returns the current setting or value of a single field of a descriptor record. Returns the current settings or values of multiple fields of a descriptor record. The fields returned describe the name, data type, and storage of column or parameter data, raima database manager error. Retrieves current field value of a status record Retrieves current values of several common fields of a status record Returns the current setting of an environment attribute. Returns information about whether a driver supports a raima database manager error ODBC function. Returns general information about the driver and data source associated with a connection. Returns the current setting of a statement attribute. Returns information about data types supported by the data source. Determines whether more results are available on a statement containing SELECT, UPDATE, INSERT, or DELETE statements and, if so, initializes processing for those results. Returns the SQL string as modified by the driver. SQLNativeSql does not execute the SQL statement. Determines the number of parameters in a prepared statement Returns the number of columns in a result set. SQLParamData is used together with SQLPutData to supply parameter data at statement execution time, raima database manager error, and with SQLGetData to retrieve streamed output parameter data. Prepares an SQL string for execution. Returns the column names that make up the primary key for a table. The driver returns the information as a result set. This function does not support returning primary keys raima database manager error multiple tables raima database manager error a single call. RDM ODBC API Reference 30

31 Function Name SQLProcedureColumns Returns the parameter and column information about the specified procedures. SQLProcedures Returns the list of procedure names stored in a specific data source. Procedure is a generic term used to describe an executable object, or a named entity that can be invoked using input and output parameters. SQLPutData Allows an application to send data for a parameter or column to the driver at statement execution time. This function can be used to send character or binary data values in parts to a column with a character, binary, or data source specific data type (for example, parameters of the SQL_LONGVARBINARY or SQL_LONG- VARCHAR types), raima database manager error. SQLRowCount Gets row count in a table following an INSERT, UPDATE, or DELETE SQLSetConnectAttr Sets attributes that govern aspects of connections, raima database manager error. SQLSetCursorName Associates a cursor name with an active statement. SQLSetDescField Sets the value of a single field of a descriptor record. SQLSetDescRec Sets multiple descriptor fields that affect the data type and buffer bound to a column or parameter data. SQLSetEnvAttr Sets attributes that govern aspects of environments. SQLSetError Registers user-defined status/error handling functions. SQLSetStmtAttr Sets attributes related to a statement SQLSpecialColumns Returns the information about the set of columns that uniquely identifies a row in the table. SQLStatistics Retrieves a list of statistics about a single table and the indexes associated with the table. The driver returns the information as a result set. SQLTables Returns the list of table, catalog, or schema names, and table types, stored in a specific data source. SQLTransactStatus Retrieves the type and status of the transaction possibly executed on the handle. RDM ODBC API Reference 31

32 SQLAllocHandle Allocates an environment, connection, statement, or descriptor handle. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLAllocHandle( SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) Arguments HandleType (input) The type of handle to be allocated by SQLAllocHandle. Must be one of the following values: SQL_HANDLE_ENV SQL_HANDLE_DBC SQL_HANDLE_STMT SQL_HANDLE_DESC InputHandle (input) The input handle in whose context the new handle is to be allocated. If HandleType is SQL_HANDLE_ENV, this is SQL_NULL_HANDLE. If HandleType is SQL_HANDLE_DBC, this must be an environment handle, and if it is SQL_HAN- DLE_STMT or SQL_HANDLE_DESC, it must be a connection handle. OutputHandlePtr (output) Pointer to a buffer in which to return the handle to the newly allocated data structure. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code RDM ODBC API Reference 32

33 SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header raima database manager error. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Comments This function allocates an environment, connection, or SQL statement handle and its associated resources. RDM does not require you to allocate an environment handle before allocating connection or statement handles, and doing so currently has no effect. The environment handle type is included only for ODBC compatibility. For more information, reference MSDN documentation for SQLAllocHandle. RDM ODBC API Reference 33

34 SQLBindCol Binds application data buffers to columns in the result set. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLBindCol( SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) Arguments StatementHandle (input) Statement handle. ColumnNumber (input) The column's location in the result data set. Columns are numbered sequentially from left to right, starting with 1, as they appear in the result data set. TargetType (input) The data type of the value buffer that the column data being retrieved is to be stored in. TargetValue (output) A pointer to a location in memory where the driver is to store column data when it is retrieved (fetched) from the result data set or where the application is to store column data that is to be written to a data source with a positioned UPDATE or DELETE operation. BufferLength (input) The size of the buffer. StrLen_or_Ind (output) A pointer to a location in memory where this function is to store either the size of the data value associated with the column or a special indicator value associated with the column data. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. RDM ODBC API Reference 34

35 Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO Raima database manager error SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This raima database manager error is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Comments This function binds application data buffers to columns in the result set. For more information, reference MSDN documentation for SQLBindCol. RDM ODBC API Reference 35

36 SQLBindParameter Binds a buffer to a parameter marker in an SQL statement. Conformance Version Introduced: ODBC 2.0 Standards Compliance: ODBC Syntax SQLRETURN SQLBindParameter( SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT InputOutputType, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN ColumnSize, SQLSMALLINT DecimalDigits, SQLPOINTER ParameterValuePtr, SQLLEN BufferLength, SQLLEN * StrLen_or_IndPtr) Arguments StatementHandle (input) Statement handle. ParameterNumber (input) Parameter number, ordered sequentially in increasing parameter order, starting at 1. InputOutputType (input) The type of the parameter. ValueType (input) The C data type of the parameter. ParameterType (input) The size of the buffer. ColumnSize (input) The size of the column or expression of the corresponding parameter marker. DecimalDigits (input) The decimal digits of the column or expression of the corresponding parameter marker. ParameterValuePtr (deferred A pointer to a buffer for the parameter's data. input) BufferLength (input/output) Length of the ParameterValuePtr buffer in bytes. StrLen_or_IndPtr (deferred input) A pointer to a buffer for the parameter's length. Required Headers #include "sqlext.h" RDM ODBC API Reference 36

37 Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies, raima database manager error. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle, raima database manager error. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle raima database manager error a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLBindParameter. RDM ODBC API Reference 37

38 SQLCancel Cancels the processing on a statement. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLCancel( SQLHSTMT StatementHandle) Arguments StatementHandle (input) Statement handle. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record, raima database manager error. Function completed successfully, possibly with a nonfatal error (warning), raima database manager error. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is RDM ODBC API Reference 38

39 passed for an argument that requires a connection handle. Comments On RDM, SQLCancel supports the following type of processing. A function on a statement that needs data. The following types of processing are not supported due to the driver limitations. A function running asynchronously on a statement. A function running raima database manager error the statement on another thread. For more information, reference MSDN documentation for SQLCancel. RDM ODBC API Reference 39

40 SQLCloseCursor Closes a cursor that has been opened on a statement and discards pending results. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLCloseCursor( SQLHSTMT StatementHandle) Arguments StatementHandle (input) Statement handle. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, raima database manager error, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is RDM ODBC API Reference 40

41 passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLCloseCursor. RDM ODBC API Reference 41

42 SQLColAttribute Returns descriptor information for a column in a result set. Descriptor information is returned as a character string, a 32-bit descriptor-dependent value, or an integer value. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLColAttribute ( SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttributePtr, SQLSMALLINT BufferLength, SQLSMALLINT * StringLengthPtr, SQLPOINTER NumericAttributePtr) Arguments StatementHandle (input) Statement handle. ColumnNumber (input) The number of the record in the IRD from which the field value is to be retrieved. This argument corresponds to the column number of result data, ordered sequentially in increasing column order, starting at 1. Columns can be described in any order. Column 0 can be specified in this argument, but all values except SQL_DESC_TYPE and SQL_DESC_OCTET_LENGTH will return undefined values. FieldIdentifier (input) The descriptor handle. This handle defines which field in the IRD should be queried (for example, SQL_COLUMN_TABLE_NAME). CharacterAttributePtr (output) Pointer to a buffer in which to return the value in the FieldIdentifier field of the ColumnNumber row of the IRD, if the field is a character string. Otherwise, the field is unused. If CharacterAttributePtr is NULL, StringLengthPtr will still return the total number of bytes (excluding the null-termination character for character data) available to return in the buffer pointed to by CharacterAttributePtr. BufferLength (input) If FieldIdentifier is an ODBC-defined field and CharacterAttributePtr points to a character string or binary buffer, this argument should be the length of *CharacterAttributePtr. If FieldIdentifier is an ODBC-defined field and *CharacterAttributePtr is an integer, this field is ignored. If the *CharacterAttributePtr is a Unicode string (when calling SQLColAttributeW), the BufferLength argument must be an even number. If FieldIdentifier is a driver-defined field, the application indicates the nature of the field to the Driver Manager by setting the BufferLength argument. BufferLength can have the following values: If CharacterAttributePtr is a pointer to a pointer, BufferLength should have the value SQL_IS_POINTER. RDM ODBC API Reference 42

43 If CharacterAttributePtr is a pointer to a character string, the BufferLength is the length of the buffer. If CharacterAttributePtr is a pointer to a binary buffer, the application places the result of the SQL_LEN_BINARY_ATTR(length) macro in BufferLength. This places a negative value in BufferLength. If CharacterAttributePtr is a pointer to a fixed-length data type, BufferLength must be one of the following: SQL_IS_INTEGER, SQL_IS_ UNINTEGER, SQL_SMALLINT, or SQLUSMALLINT, raima database manager error. StringLengthPtr (output) Pointer to a buffer in which to return the total number of bytes (excluding the null-termination byte for character data) available to return in *CharacterAttributePtr, raima database manager error. For character data, if the number of bytes raima database manager error to return is greater than or equal to BufferLength, the descriptor information in *CharacterAttributePtr is truncated to BufferLength minus the length of a null-termination character and is null-terminated by the driver. For all other types of data, the value of BufferLength is ignored and the driver assumes the size of *CharacterAttributePtr is 32 bits. NumericAttributePtr (output) Pointer to an integer buffer in which to return the value in the FieldIdentifier field of the ColumnNumber row of the IRD, if the field is a numeric descriptor type, such as SQL_DESC_COLUMN_LENGTH, raima database manager error. Otherwise, the field is unused. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is RDM ODBC API Reference 43

44 passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLColAttribute. RDM ODBC API Reference 44

45 SQLColumns Returns the list of column names in specified tables. The driver returns this information as a result set on the specified StatementHandle. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLColumns( SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) Arguments StatementHandle (input) Statement handle. CatalogName (input) Catalog name. If a driver supports catalogs for some tables but not for others, such as when the driver retrieves data from different DBMSs, an empty string ("") indicates those tables that do not have catalogs. CatalogName cannot contain a string search pattern. NameLength1 (input) Length in characters of *CatalogName. SchemaName (input) String search pattern for schema names. If a driver supports schemas for some tables but not for others, such as when the driver retrieves data from different DBMSs, an empty string ("") indicates those tables that do not have schemas. NameLength2 (input) Length in characters of *SchemaName. TableName (input) String search pattern for table names. NameLength3 (input) Length in characters of *TableName. ColumnName (input) String search pattern for column names. NameLength4 (input) Length in characters of *ColumnName. Required Headers #include "sql.h" RDM ODBC API Reference 45

46 Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information, raima database manager error. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Comments SQLColumns returns the information that pertain to the databases that are currently open. If no database is open on the raima database manager error source, SQLColumns returns an empty result set. For more information, reference MSDN documentation for SQLColumns. RDM ODBC API Reference 46

47 SQLConnect Establishes connections to RDM databases via RDM ODBC. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLConnect( SQLHDBC ConnectionHandle, const SQLCHAR *ServerName, SQLSMALLINT NameLength1, const SQLCHAR *UserName, SQLSMALLINT NameLength2, const SQLCHAR *Authentication, SQLSMALLINT NameLength3) Arguments ConnectionHandle (input) Connection handle. ServerName (input) The name of the remote server. For the details, raima database manager error, see the Comments section. NameLength1 (input) Length of *ServerName in characters. Specify SQL_NTS if ServerName is a nullterminated string. UserName (input) This parameter is not used. NameLength2 (input) Length of *UserName in characters. Specify SQL_NTS if UserName is a null-terminated string. Authentication (input) This parameter is not used. NameLength3 (input) Length of *Authentication in characters. Specify SQL_NTS if Authentication is a null-terminated string. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code RDM ODBC API Reference 47

48 SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the raima database manager error record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, raima database manager error, such as when a statement handle is passed for an argument that requires a connection handle. Diagnostics SQLSTATE Error 01S02 Option value changed. The RDM ODBC Driver does not support the specified value for the ValuePtr argument in SQLSetConnectAttr. The specified value has been substituted by a similar value. The function returns SQL_SUCCESS_WITH_INFO Unable to connect. The RDM ODBC driver was not able to connect to the data source Connection already in use. The specified connection handle is already used for an existing connection. HY001 Driver memory allocation error The RDM ODBC driver failed to allocate memory required to complete the operation. HY013 Memory management error The function could not complete the operation due to the out-ofmemory condition in the data source. Comments The value for the ServerName parameter specifies the name of the remote server for the data source. It is the TCP/IP host name of the computer where the remote server is running. The behavior of SQLConnect changes depending upon the combination of this value and the connection type, set with SQL_ATTR_RDM_CONN_TYPE attribute using SQLSetConnectAttr, as follows. ServerName Connection Actual Connection Names Actual Server Type NULL/empty Not set Local TFS SQL_ATTR_RDM_TFS_NAME Remote N/A Local Local TFS SQL_ATTR_RDM_TFS_NAME Remote N/A Remote Remote TFS SQL_ATTR_RDM_TFS_NAME Remote SQL_ATTR_RDM_REMOTE_ NAME RDM ODBC API Reference 48

49 ServerName Connection Actual Connection Names Actual Server Type Set Not set Remote TFS SQL_ATTR_RDM_TFS_NAME Remote ServerName Local Local TFS ServerName Remote N/A Remote Remote TFS SQL_ATTR_RDM_TFS_NAME Remote ServerName The UserName, Authentication, NameLength2 and NameLength3 parameters are currently raima database manager error used in RDM ODBC since RDM does not support user authentication. Values specified for those parameters will be ignored. For more information, reference Raima database manager error documentation for SQLConnect. RDM ODBC API Reference 49

50 SQLCopyDesc Copies descriptor information from one descriptor handle to another. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLCopyDesc( SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle); Arguments SourceDescHandle (input) Source descriptor handle. TargetDescHandle (input) Target descriptor handle. The TargetDescHandle argument can be a handle to an application descriptor or an IPD. TargetDescHandle cannot be set to a handle to an IRD, raima database manager error, or SQLCopyDesc will return SQLSTATE HY016 (Cannot modify an implementation row descriptor). Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information, raima database manager error. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. RDM ODBC API Reference 50

51 SQL_INVALID_HANDLE Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLCopyDesc. RDM ODBC API Reference 51

52 SQLDescribeCol Retrieves the basic result data set for a column Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLDescribeCol( SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLengthPtr, SQLSMALLINT *DataTypePtr, SQLULEN *ColumnSizePtr, SQLSMALLINT *DecimalDigitsPtr, SQLSMALLINT *NullablePtr) Arguments StatementHandle (input) Statement handle. ColumnNumber (input) Column number of result data, ordered sequentially in increasing column order, starting at 1, raima database manager error. ColumnName (output) Pointer to a null-terminated buffer in which to return the column name. This value is read from the SQL_DESC_NAME field of the IRD. If the column is unnamed or the column name cannot be determined, the driver returns an empty string. If ColumnName is NULL, NameLengthPtr will still return the total number of characters (excluding the null-termination character for character data) available to return in the buffer pointed to by ColumnName. BufferLength (input) Length of the *ColumnName buffer, in characters. NameLengthPtr (output) Pointer to a raima database manager error in which to return the total number of characters (excluding the null termination) available to return in *ColumnName. If the number of characters available to return is greater than or equal to BufferLength, the column name in *ColumnName is truncated to BufferLength minus the length of a null-termination character. DataTypePtr (output) Pointer to a buffer in which to return the SQL data type of the column. This value is read from the SQL_DESC_CONCISE_TYPE field of the IRD. This will be one of the values in SQL Data Types, or a driver-specific SQL data type. If the data type cannot be determined, the driver returns SQL_UNKNOWN_TYPE. ColumnSizePtr (output) Pointer to a buffer in which to return the size (in characters) of the column on the data source. If the column size cannot be determined, the driver returns 0. DecimalDigitsPtr (output) Pointer to a buffer in which to return the number of decimal digits of the column on the data source. If the number of decimal digits cannot be determined or is not applicable, raima database manager error, the driver returns 0. RDM ODBC API Reference 52

53 NullablePtr (output) Pointer to a buffer in which to return a value that indicates whether the column allows NULL values. This value is read from the SQL_DESC_NULLABLE field of the IRD. The value is one of the following: SQL_NO_NULLS: The column does not allow NULL values. SQL_NULLABLE: The column allows NULL values. SQL_NULLABLE_UNKNOWN: The driver cannot determine if the column allows NULL values. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning), raima database manager error. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined, raima database manager error. Function failed due to an raima database manager error environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLDescribeCol. RDM ODBC API Reference 53

54 SQLDescribeParam Retrieves description of a parameter marker Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLDescribeParam( SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT *DataTypePtr, SQLULEN *ParameterSizePtr, SQLSMALLINT *DecimalDigitsPtr, SQLSMALLINT *NullablePtr) Arguments StatementHandle (input) Statement handle. ParamNumber (input) Specifies the parameter number in the SQL statement text. Parameter numbers are numbered sequentially from left to right, starting with 1, as they appear in the SQL statement. DataTypePtr (output) Pointer to a buffer in which to return the SQL data type of the parameter. ParameterSizePtr (output) Pointer to a buffer in which to return the size, in characters, of the column or expression of the corresponding parameter marker as defined by the data source. DecimalDigitsPtr (output) Pointer to a buffer in which to return the number of decimal digits of the column or expression of the corresponding parameter as defined by the data source. NullablePtr (output) Pointer to a buffer in which to return a value that indicates whether the parameter allows NULL values. Required Headers #include "sqlext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code RDM ODBC API Reference 54

55 SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve raima database manager error information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLDescribeParam. RDM ODBC API Reference 55

56 SQLDescribeStmt Retrieves the type of the SQL statement executed on the handle. Conformance Version Introduced: RDM ODBC API extension Syntax SQLRETURN SQL_API SQLDescribeStmt( SQLHSTMT StatementHandle, SQLUSMALLINT *pstmttype) Arguments StatementHandle (input) Statement handle. pstmttype (output) The type of the SQL statement executed on the statement handle. Possible values returned through this parameter are described in the Comments section below. Required Headers #include "sqlrext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is RDM ODBC API Reference 56

57 passed for an raima database manager error that requires a connection handle. Diagnostics SQLSTATE Error HY009 Invalid use of null pointer A null pointer was specified for the pstmttype argument. HY010 Function sequence error This function was called before the statement was prepared. Comments The following table describes the types of SQL statements executed and the corresponding values of the statement type returned to this function through pstmttype.

58 [1] Any of the DDL statements supported by RDM, such as CREATE DATABASE and CREATE TABLE, returns SQL_RDM_STMT_DDL. RDM ODBC API Reference 58

59 SQLDisconnect Closes the connection associated with a specified handle Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLDisconnect( SQLHDBC ConnectionHandle) Arguments ConnectionHandle (input) Connection handle. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is RDM ODBC API Reference 59

60 passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLDisconnect. RDM ODBC API Reference 60

61 SQLDriverConnect Establishes connections to RDM databases via RDM ODBC. Accepts more connection options than SQLConnect. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLDriverConnect( SQLHDBC ConnectionHandle, SQLHWND WindowHandle, const SQLCHAR *InConnectionString, SQLSMALLINT StringLength1, raima database manager error, SQLCHAR *OutConnectionString, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength2Ptr, SQLUSMALLINT DriverCompletion) Arguments ConnectionHandle (input) Connection handle. WindowHandle (input) Window handle. InConnectionString (input) A full connection string (see the syntax in "Comments"), a partial connection string, or an empty string. StringLength1 (input) Length of *InConnectionString, in characters if the string is Unicode, or bytes if string is ANSI or DBCS. OutConnectionString (output) Pointer to a buffer for the completed connection string. Upon successful connection to the target data source, this buffer contains the completed connection string. Applications should allocate at least 1,024 characters for this buffer. BufferLength (input) Length of the *OutConnectionString buffer, in characters. StringLength2Ptr (output) Pointer to a buffer in which to return the total number of characters (excluding the null-termination character) available to return in *OutConnectionString. If the number of characters available to return is greater than or equal to BufferLength, raima database manager error, the completed connection string in *OutConnectionString is truncated to BufferLength minus the length of a null-termination character. DriverCompletion (input) Flag that indicates whether the Driver Manager or driver must prompt for more connection information Required Headers #include "sqlext.h" RDM ODBC API Reference 61

62 Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE SQL_NO_DATA Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. No more data was available. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Comments InConnectionString RDM accepts the following connection string keywords. Keyword DSN PORT TFS [1] REMOST_HOST [1] Attribute Value When the application accesses the RDM ODBC Driver through Microsoft ODBC Driver Manager (DM), raima database manager error, this is the name of an ODBC data source that points to RDM. The value of this keyword is ignored if the application is linked directly with the RDM ODBC Driver. TCP/IP port number the TFServer is listening on, raima database manager error. If PORT is not specified, RDM will use the default value (21553). Name of the TFServer. This keyword should be specified instead of DSN when an application attempts to specify our driver with the DRIVER keyword through the Microsoft ODBC DM, in which case the DM will remove the DSN keyword from the connection string. If TFS is specified, RDM will use its default TFServer name ("localhost"). Name of the remote server. If REMOTE_HOST is not specified, RDM will use its default remote server name ("localhost"). RDM ODBC API Reference 62

63 Keyword DATABASE Attribute Value Name of the database to open upon successful connection to the data source. For more information, raima database manager error, reference MSDN documentation for SQLDriverConnect. RDM ODBC API Reference 63

64 SQLEndTran Requests a commit or rollback for active transactions Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLEndTran( SQLSMALLINT HandleType, raima database manager error, SQLHANDLE Handle, SQLSMALLINT CompletionType) Arguments HandleType (input) Handle type identifier. Contains either SQL_HANDLE_ENV (if Handle is an environment handle) or SQL_HANDLE_DBC (if Handle is a connection handle). Handle (input) The handle, raima database manager error, of the type indicated by HandleType, indicating the scope of the transaction. CompletionType (input) One of the following two values: SQL_COMMIT SQL_ROLLBACK Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. RDM ODBC API Reference 64

65 SQL_ERROR SQL_INVALID_HANDLE Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle, raima database manager error. For more information, reference MSDN documentation for SQLEndTran. RDM ODBC API Reference 65

66 SQLExecDirect Prepares and executes an SQL statement Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQL_API SQLExecDirect( SQLHSTMT StatementHandle, const SQLCHAR *StatementText, SQLINTEGER TextLength) Arguments StatementHandle (input) Statement handle. StatementText (input) SQL statement to be executed. TextLength (input) Length of *StatementText in characters. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, raima database manager error, or RDM ODBC API Reference 66

67 SQL_NEED_DATA SQL_NO_DATA descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. More data is needed, such as when parameter data is sent at execution time or additional connection information is required. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information, if any. No more data was available. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. For more information, reference MSDN documentation for SQLExecDirect, raima database manager error. RDM ODBC API Reference 67

68 SQLExecute Executes a previously prepared SQL statement Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLExecute( SQLHSTMT StatementHandle); Arguments StatementHandle (input) Statement handle. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is RDM ODBC API Reference 68

69 SQL_NEED_DATA SQL_NO_DATA passed for an argument that requires a connection handle. More data is needed, such as when parameter data is sent at execution time or additional connection information is required. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information, if any. No more data was available. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. For more information, reference MSDN documentation for SQLExecute. RDM ODBC API Reference 69

70 SQLExtendedTran Performs a transaction operation Conformance Version Introduced: RDM ODBC API extension Syntax SQLRETURN SQL_API SQLExtendedTran( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT TransType, SQLSMALLINT ReadOnly, const SQLCHAR *TransactionID, SQLSMALLINT StringLengthPtr) Arguments HandleType (input) Handle type identifier. Contains either SQL_HANDLE_ENV (if Handle is an environment handle) or SQL_HANDLE_DBC (if Handle is a connection handle). Handle (input) The handle, of the type indicated by HandleType, indicating the scope of the transaction. OperationType (input) One of the following operation types: SQL_START -Start a transaction SQL_SAVEPOINT -Create a save point in a transaction SQL_RELEASE Release a save point in a transaction SQL_COMMIT -Commit a transaction SQL_ROLLBACK -Rollback a transaction ReadOnly raima database manager error Read-only mode, as follows: SQL_TRUE Transaction is read-only. SQL_FALSE Transaction is read-write If OperationType is not SQL_START or SQL_COMMIT, this parameter is ignored. TransactionID (input) Character string that indicates the unique ID of the transaction operation. If Operation Code is SQL_COMMIT, this parameter is ignored. If TransactionID is not specified with SQL_START, an internal system value will be used. TransactionID is required with SQL_SAVEPOINT and SQL_RELEASE. StringLengthPtr (input) The length of TransactionID in characters. SQL_NTS can be used to indicate that TransactionID is null-terminated. RDM ODBC API Reference 70

71 Required Headers #include "sqlrext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Diagnostics SQLSTATE Error General warning General error returned from the RDM ODBC driver. The function returns SQL_SUCCESS_WITH_INFO Connection not open The RDM ODBC driver is not connected to a data source Transaction already active SQL_START is specified for OperationType and a transaction is already active on the connection associated with Handle Read-only transaction already active SQL_START, SQL_SAVEPOINT or SQL_RELEASE is specified for OperationType and a read-only transaction is active on the connection associated with Handle. 25S01 Transaction state unknown When HandleType is SQL_HANDLE_ENV and one or more of the connections in Handle failed to complete the transaction. HY001 Memory allocation error Either the ODBC driver or the SQL engine failed to allocate sufficient memory to complete the required operation. HY010 Function sequence error This function was called after SQLExecute or SQLEx- RDM ODBC API Reference 71

72 HY012 Invalid transaction operation code ecdirect but before all the parameters were bound. The value in OperationType is not one of the following: SQL_START SQL_SAVEPOINT SQL_RELEASE SQL_COMMIT SQL_ROLLBACK HY013 Memory management error The RDM SQL engine failed to allocate sufficient memory to complete the required operation. HY092 Invalid attribute/option identifier The value in HandleType is not one of the following values: SQL_HANDLE_ENV SQL_HANDLE_DBC Comments SQLExtendedTran allows an RDM ODBC application to start a transaction, create a save point inside the current transaction, and roll back to the last save point, as well as committing and rolling back a transaction. Starting a transaction Creating a save point Releasing a save point Rolling back to a save point Committing a transaction SQLExtendedTran can be called to start a regular ("read-write") transaction or a "read-only" transaction. The value specified for the ReadOnly parameter determines the type of transaction to start. To start a read-only transaction, specify SQL_TRUE for the ReadOnly parameter. An application can optionally specify the unique ID of the transaction by using the TransactionID parameter. If NULL or an empty string is specified for the TransactionID parameter, an internal system ID will be used SQLExtendedTran can be used to create a save point in the current readwrite transaction. An application must specify a unique ID of the save point using the TransactionID parameter. An application can roll back the database changes that are made after the save point by calling SQLExtendedTran with SQL_ROLLBACK and the ID that matches the one associated with the save point. An application can manually release, raima database manager error discard, any of the save points it created by calling SQLExtendedTran specifying SQL_RELEASE for OperationType and the ID associated with the save point. A call to SQLEndTran to either commit or abort the current transaction will automatically release all save points. A call to SQLExtendedTran to roll back to a save point will automatically release all the save points created after that save point. An application can roll back a transaction to a particular save point by calling SQLExtendedTran specifying SQL_ROLLBACK for OperationType and the ID associated with the save point. All save points created after the specified save point will be released. If the specified ID is not associated with any existing save point, the entire transaction will be aborted. An application can commit all changes in a transaction by calling SQLEndTran or SQLExtendedTran specifying SQL_COMMIT. All save points inside the RDM ODBC API Reference 72

73 Aborting a transaction transaction will be released. If no transaction is active, SQL_SUCCESS will be returned. An application can abort an entire transaction by calling SQLEndTran or SQLExtendedTran specifying SQL_ROLLBACK. For SQLExtendedTran, specify NULL or the ID of the transaction itself for TransactionID. All save points inside the transaction will be released. If no transaction is active, SQL_ SUCCESS will be returned. RDM ODBC API Reference 73

74 SQLFetch Fetches data from a bound column to an application variable Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLFetch( SQLHSTMT StatementHandle); Arguments StatementHandle (input) Statement handle. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully, raima database manager error. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is RDM ODBC API Reference 74

75 passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLFetch. RDM ODBC API Reference 75

76 SQLFetchScroll Fetches the specified rowset of data from the result set and returns data for all bound columns. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLFetchScroll( SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset); Arguments StatementHandle (input) Statement handle. FetchOrientation (input) Type of fetch: SQL_FETCH_NEXT SQL_FETCH_PRIOR SQL_FETCH_FIRST SQL_FETCH_LAST SQL_FETCH_ABSOLUTE SQL_FETCH_RELATIVE SQL_FETCH_BOOKMARK FetchOffset (input) Number of the row to fetch. The interpretation raima database manager error this argument depends on the value of the FetchOrientation argument. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code RDM ODBC API Reference 76

77 SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE SQL_NO_DATA Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, raima database manager error, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. No more data was available. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Comments Cursor Support SQLFetchScroll in RDM ODBC currently only supports the forward-only cursor. Therefore, raima database manager error, the only accepted value for the FetchOrientation parameter is SQL_FETCH_NEXT. Specifying any other fetch type for FetchOrientation will result in the "Fetch type out of range" (SQLSTATE HY106) error. The value specified for the FetchOffset parameter is ignored. For more information, reference MSDN documentation for SQLFetchScroll. RDM ODBC API Reference 77

78 SQLForeignKeys SQLForeignKeys can return: A list of foreign keys in the specified table (columns in the specified table that refer to primary keys in other tables). A list of foreign keys in other tables that refer to the primary key in the specified table. The driver returns each list as a result set on the specified statement. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLForeignKeys( SQLHSTMT StatementHandle, SQLCHAR * PKCatalogName, raima database manager error, SQLSMALLINT NameLength1, SQLCHAR * PKSchemaName, SQLSMALLINT NameLength2, SQLCHAR * PKTableName, SQLSMALLINT NameLength3, SQLCHAR * FKCatalogName, SQLSMALLINT NameLength4, SQLCHAR * FKSchemaName, SQLSMALLINT NameLength5, raima database manager error, SQLCHAR * FKTableName, SQLSMALLINT NameLength6); Arguments StatementHandle (input) Statement handle. PKCatalogName (input) Primary key table catalog name, raima database manager error. PKCatalogName cannot contain a string search pattern. NameLength1 (input) Length of *PKCatalogName, in characters. PKSchemaName (input) Primary key table schema name. PKSchemaName cannot contain a string search pattern. NameLength2 (input) Length of *PKSchemaName, in characters. PKTableName (input) Primary key table name. PKTableName cannot contain a string search pattern. NameLength3 (input) Length of *PKTableName, in characters. FKCatalogName (input) Foreign key table catalog name. FKCatalogName cannot contain a raima database manager error search pattern. NameLength4 (input) Length of *FKCatalogName, in characters. FKSchemaName (input) Foreign key table schema name. FKSchemaName cannot contain a string search pattern. NameLength5 (input) Length of *FKSchemaName, in characters. FKTableName (input) Foreign key table name. FKTableName cannot contain a string search raima database manager error. RDM ODBC API Reference 78

79 NameLength6 (input) Length raima database manager error *FKTableName, in characters. Required Headers #include "sqlext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record, raima database manager error. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error, raima database manager error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Comments SQLForeignKeys returns the information that pertains to the databases that are currently open. If no database is open on the data source, SQLForeignKeys returns an empty result set. For more information, reference MSDN documentation for SQLForeignKeys. RDM ODBC API Reference 79

80 SQLFreeHandle Frees resources associated with a specific environment, connection, statement, or descriptor handle. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLFreeHandle( SQLSMALLINT HandleType, SQLHANDLE Handle); Arguments HandleType (input) The type of handle to be freed by SQLFreeHandle. Must be one of the following values: SQL_HANDLE_DBC SQL_HANDLE_DESC SQL_HANDLE_ENV SQL_HANDLE_STMT If HandleType is not one of these values, SQLFreeHandle returns SQL_ INVALID_HANDLE. Handle (input) The handle to be freed. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_ERROR Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function failed. The application calls SQLGetDiagRec or SQLGet- RDM ODBC API Reference 80

81 SQL_INVALID_HANDLE DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, raima database manager error, reference MSDN documentation for SQLFreeHandle. RDM ODBC API Reference 81

82 SQLFreeStmt Stops processing associated with a specific statement, closes any open cursors associated with the statement, discards pending results, or, optionally, frees all resources associated with the statement handle. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLFreeStmt( SQLHSTMT StatementHandle, SQLUSMALLINT Option); Arguments StatementHandle (input) Statement handle. Option (input) One of the following options: SQL_ CLOSE: Closes the cursor raima database manager error with StatementHandle (if one was defined) and discards all pending results. The application can reopen this cursor later by executing a SELECT statement again with the same or different parameter values. If no cursor is open, this option has no effect for the application. SQLClose- Cursor can also be called to close a cursor. For more information, see Closing the Cursor. SQL_DROP: This option is deprecated. A call to Raima database manager error with an Option of SQL_DROP is mapped in the Driver Manager to SQLFreeHandle, raima database manager error. SQL_UNBIND: Sets the SQL_DESC_COUNT field of the ARD to 0, releasing all column buffers bound by SQLBindCol for the given StatementHandle. This does not unbind the bookmark column; to do that, the SQL_DESC_DATA_PTR field of the ARD for the bookmark column is set to NULL. Notice that if this operation is performed on an explicitly allocated descriptor that is shared by more than one statement, the operation will affect the bindings of all statements that share the descriptor, raima database manager error. SQL_RESET_PARAMS: Sets the SQL_DESC_COUNT field of the APD to 0, releasing all parameter buffers set by SQLBindParameter for the given StatementHandle. If this operation is performed on an explicitly allocated descriptor that is shared by more than one statement, this operation will affect the bindings of all the statements that share the descriptor. RDM ODBC API Reference 82

83 Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning), raima database manager error. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLFreeStmt. RDM ODBC API Reference 83

84 SQLGetConnectAttr Returns the current setting of a connection raima database manager error. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN Severe error 0x3010002 SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER BufferLength, SQLINTEGER * StringLengthPtr); Arguments ConnectionHandle (input) Connection handle. Attribute (input) Attribute to retrieve. ValuePtr (output) A pointer to memory in which to return the current value of the attribute specified by Attribute. BufferLength (input) If Attribute is an ODBC-defined attribute and ValuePtr points to a character string or a binary buffer, this argument should be the length of *ValuePtr. If Attribute is an ODBC-defined attribute and *ValuePtr is an integer, BufferLength is ignored. StringLengthPtr (output) A pointer to a buffer in which to return the total number of bytes (excluding the nulltermination character) available to return in *ValuePtr. If *ValuePtr is a null pointer, no length is returned. If the attribute value is a character string and the number of bytes available to return is greater than BufferLength minus the length of the null-termination character, the data in *ValuePtr is truncated to BufferLength minus the length of the null-termination character and is null-terminated by the driver. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. RDM ODBC API Reference 84

85 Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, raima database manager error, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Comments The attributes accepted by SQLGetConnectAttr are listed under SQLSetConnectAttr. For more information, reference MSDN documentation for SQLGetConnectAttr. RDM ODBC API Reference 85

86 SQLGetCursorName Retrieves the cursor name of an SQL statement handle Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetCursorName( SQLHSTMT StatementHandle, SQLCHAR * CursorName, SQLSMALLINT BufferLength, SQLSMALLINT * NameLengthPtr); Arguments StatementHandle (input) Statement handle. CursorName (output) Pointer to a buffer in which to return the cursor name, raima database manager error. BufferLenght (input) Length of *CursorName, raima database manager error, in characters. NameLengthPrt (output) Pointer to memory in which to return the total number of characters (excluding the null-termination character) available to return in *CursorName. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, raima database manager error, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information, raima database manager error. Function failed. The application calls SQLGetDiagRec or SQLGet- RDM ODBC API Reference 86

87 SQL_INVALID_HANDLE DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, raima database manager error, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLGetCursorName. RDM ODBC API Reference 87

88 SQLGetData Retrieves data for a single column in the result set. It can be called multiple times to retrieve variable-length data in parts. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetData( SQLHSTMT StatementHandle, SQLUSMALLINT Col_or_Param_Num, SQLSMALLINT TargetType, SQLPOINTER TargetValuePtr, SQLLEN BufferLength, SQLLEN * StrLen_or_IndPtr); Arguments StatementHandle (input) Statement handle. Col_or_Param_Num (input) For retrieving column data, it is the number of the column for which to return data. Result set columns are numbered in increasing column order starting raima database manager error 1. The bookmark column is column number 0; this can be specified only if bookmarks are enabled. For retrieving parameter data, it is the ordinal of the parameter, which starts at 1. TargetType (input) The type identifier of the C data type of the *TargetValuePtr buffer. For a list of valid C data types and type identifiers TargetValuePrt (output) Pointer to the buffer in which to return the data, raima database manager error. BufferLength (input) Length of the *TargetValuePtr buffer in bytes. StrLen_or_IndPtr (output) Pointer to the buffer in which to return the length or indicator value. If this is a null pointer, no length or indicator value is returned. This returns an error when the data being fetched is NULL. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. RDM ODBC API Reference 88

89 Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record, raima database manager error. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLGetData. RDM ODBC API Reference 89

90 SQLGetDescField Returns the current setting or value of a single field of a descriptor record. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetDescField( SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER ValuePtr, SQLINTEGER BufferLength, SQLINTEGER * StringLengthPtr); Arguments DescriptorHandle (input) Descriptor handle. RecNumber (input) Indicates the descriptor record from which the application seeks information. Descriptor records are numbered from 0, with record number 0 being the bookmark record. If the FieldIdentifier argument indicates a header field, RecNumber is ignored. If RecNumber is less than or equal to SQL_DESC_COUNT but the row does not contain data for a column or parameter, a call to SQLGetDescField will return the default values of the fields. FieldIdentifier (input) Indicates the field of the descriptor whose value is to be returned, raima database manager error. ValuePtr (output) Pointer to a buffer in which to return the descriptor information. The data type depends on the value of FieldIdentifier. If ValuePtr is NULL, StringLengthPtr will still return the total number of bytes (excluding the null-termination character for character data) available to return in the buffer pointed to by ValuePtr. BufferLength (input) If FieldIdentifier is an ODBC-defined field and ValuePtr points to a character string or a binary buffer, this argument should be the length of *ValuePtr. If FieldIdentifier is an ODBC-defined field and *ValuePtr is an integer, BufferLength is ignored. StringLengthPtr (output) Pointer to the buffer in which to return the total number of bytes (excluding the number of bytes required for the null-termination character) available to return in *ValuePtr. Required Headers #include "sql.h" RDM ODBC API Reference 90

91 Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLGetDescField. RDM ODBC API Reference 91

92 SQLGetDescRec Returns the current settings or values of multiple fields of a descriptor record. The fields returned describe the name, data type, and storage of column or parameter data. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetDescRec( SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR * Name, SQLSMALLINT BufferLength, SQLSMALLINT * StringLengthPtr, SQLSMALLINT * TypePtr, SQLSMALLINT * SubTypePtr, SQLLEN * LengthPtr, SQLSMALLINT * PrecisionPtr, raima database manager error, SQLSMALLINT * ScalePtr, SQLSMALLINT * NullablePtr); Arguments DescriptorHandle (input) Descriptor handle. RecNumber (input) Indicates the descriptor record from which the application seeks information. Descriptor records are numbered from 1, with record number 0 being the bookmark record. The RecNumber argument must be less than or equal to the value of SQL_ DESC_COUNT. If RecNumber is less than or equal to SQL_DESC_COUNT but the raima database manager error does not contain data for a column or parameter, a call to SQLGetDescRec will return the default values of the fields. Name (output) A pointer to a buffer in which to return the SQL_DESC_NAME field for the descriptor record. If Name is NULL, StringLengthPtr will still return the total number of characters (excluding the null-termination character for character data) available to return in the buffer pointed to by Name. BufferLength (input) Length of the *Name buffer, raima database manager error characters. StringLengthPtr (output) A pointer to a buffer in which to return the number of characters of data available to return in the *Name buffer, excluding the null-termination character. If the number of characters was greater than or equal to BufferLength, the data in *Name is truncated to BufferLength minus the length of a null-termination character, and is null-terminated by the driver. TypePtr (output) A pointer to a buffer in which to return the value of the SQL_DESC_TYPE field for the descriptor record. SubTypePtr (output) For records whose type is SQL_DATETIME or SQL_INTERVAL, this is a pointer to a buffer in which to return the value of the SQL_DESC_DATETIME_INTERVAL_ RDM ODBC API Reference 92

93 CODE field. LengthPtr (output) A pointer to a buffer in which to return the value of the SQL_DESC_OCTET_ LENGTH field for the descriptor record. PrecisionPtr (output) A pointer to a buffer in which to return the value of the SQL_DESC_PRECISION field for the descriptor record. ScalePtr (output) A not a winsock error rnq to a buffer in which raima database manager error return the value of the SQL_DESC_SCALE field for the descriptor record. NullablePtr (output) A pointer to a buffer in which to return the value of the SQL_DESC_NULLABLE field for the descriptor record. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Raima database manager error Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE SQL_NO_DATA Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined, raima database manager error. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle, raima database manager error. No more data was available. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. SQL_NO_DATA is returned if RecNumber is greater than the current number of descriptor records. SQL_NO_DATA is returned if DescriptorHandle is an IRD handle and the statement is in the prepared or executed state but there was no open cursor associated with it. For more information, reference MSDN documentation for SQLGetDescRec. RDM ODBC API Reference 93

94 SQLGetDiagField Retrieves current field value of a status record Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetDiagField( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfoPtr, SQLSMALLINT BufferLength, SQLSMALLINT * StringLengthPtr) Arguments HandleType (input) A handle type identifier that describes the type of handle for which diagnostics are required. Must be one of the following: SQL_HANDLE_ENV SQL_HANDLE_DBC SQL_HANDLE_STMT SQL_HANDLE_DESC Handle (input) A handle for the diagnostic data structure, of the type indicated by HandleType. RecNumber (input) Indicates the status record from which the application seeks information. Status records are numbered from 1. If the DiagIdentifier argument indicates any field of the diagnostics header, RecNumber is ignored. If not, it should be more than 0. DiagIdentifier (input) Indicates the field of the diagnostic whose value is to be returned. DiagInfoPtr (output) Pointer to a buffer in which to return the diagnostic information. The data type depends on the value of DiagIdentifier. If DiagInfoPtr is NULL, StringLengthPtr will still return the total number of bytes (excluding the null-termination character for character data) available to return in the buffer pointed to by DiagInfoPtr. BufferLength (input) If DiagIdentifier is an ODBC-defined diagnostic and DiagInfoPtr points to a character string or a binary buffer, this argument should be the length of *DiagInfoPtr. If DiagIdentifier is an ODBC-defined field and *DiagInfoPtr is an integer, BufferLength is ignored. StringLengthPtr (output) Pointer to a buffer in which to return the total number of bytes (excluding the number of bytes required for the null-termination character) available to return in *DiagInfoPtr, for character data. If the number of bytes available to return raima database manager error greater than or equal to BufferLength, the text in *DiagInfoPtr is truncated to BufferLength minus the length of a null-termination character. RDM ODBC API Reference 94

95 Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with raima database manager error nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, raima database manager error, reference MSDN documentation for SQLGetDiagField. RDM ODBC API Reference 95

96 SQLGetDiagRec Retrieves current values of several common fields of a status record Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetDiagRec( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLCHAR * SQLState, SQLINTEGER * NativeErrorPtr, SQLCHAR * MessageText, SQLSMALLINT BufferLength, SQLSMALLINT * TextLengthPtr) Arguments HandleType (input) A handle type identifier that describes the type of handle for which diagnostics are required. Must be one of the following: SQL_HANDLE_ENV SQL_HANDLE_DBC SQL_HANDLE_STMT SQL_HANDLE_DESC Handle (input) A handle for the diagnostic data structure, of the type indicated by HandleType. RecNumber (input) Indicates the status record from which the application seeks information. Status records are numbered from 1. SQLState (output) Pointer to a buffer in which to return a five-character SQLSTATE code (and terminating NULL) for the diagnostic record RecNumber. The first two characters indicate the class; the next three indicate the subclass. This information is contained in the SQL_DIAG_SQLSTATE diagnostic field. NativeErrorPtr (output) Pointer to a buffer in which to return the native error code, specific to the data source. This information is contained in the SQL_DIAG_NATIVE diagnostic field. MessageText (output) Pointer to a buffer in which to return the diagnostic message text string. This information is contained in the SQL_DIAG_MESSAGE_TEXT diagnostic field. BufferLength (input) Length of the *MessageText buffer in characters. There is no maximum length of the diagnostic message text. TextLengthPtr (output) Pointer to a buffer in which to return the total number of characters (excluding the number of characters required for the null-termination character) available to return in *MessageText. If the number of characters available to return is greater than BufferLength, the diagnostic message text in *MessageText is truncated to BufferLength minus the length of a null-termination character, raima database manager error. RDM ODBC API Reference 96

97 Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle, raima database manager error. For more information, reference MSDN documentation for SQLGetDiagRec. RDM ODBC API Raima database manager error 97

98 SQLGetEnvAttr Returns the current setting of an environment attribute. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetEnvAttr( SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER BufferLength, SQLINTEGER * StringLengthPtr) Arguments EnvironmentHandle (input) Environment handle. Attribute (input) Attribute to retrieve. ValuePtr (output) Pointer to a buffer in which to return the current value of the attribute specified by Attribute. If ValuePtr is NULL, StringLengthPtr will still return the total number of bytes (excluding the null-termination character for character data) available to return in the buffer pointed to by ValuePtr. BufferLength (input) If ValuePtr points to a character string, this argument should be the length of *ValuePtr. If *ValuePtr is an integer, BufferLength is ignored. If the attribute value is not a character string, BufferLength is unused. StringLengthPtr (output) A pointer to a buffer in which to return the total number of bytes (excluding the nulltermination character) available to return in *ValuePtr. If ValuePtr is a null pointer, no length is returned. If the attribute value is a character string and the number of bytes available to return is greater than or equal to BufferLength, the data in *ValuePtr is truncated to BufferLength minus the length of a null-termination character and is null-terminated by the driver. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section raima database manager error full library name and a list of library dependencies. RDM ODBC API Reference 98

99 Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an raima database manager error environment, connection, raima database manager error, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Comments The attributes accepted by SQLGetEnvAttr are listed under SQLSetEnvAttr. For more information, reference MSDN documentation for SQLGetEnvAttr. RDM ODBC API Reference 99

100 SQLGetFunctions Returns information about whether a driver supports a specific ODBC function. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetFunctions( SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT * SupportedPtr) Arguments ConnectionHandle (input) Connection handle. FunctionId (input) A #define value that identifies the ODBC function of interest; SQL_API_ODBC3_ ALL_FUNCTIONS or SQL_API_ALL_FUNCTIONS. SupportedPtr (output) If FunctionId identifies a single ODBC function, SupportedPtr points to a single SQLUSMALLINT value that is SQL_TRUE if the specified function is supported by the driver, and SQL_FALSE if it is not supported. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full motorola w5 error 35 02 name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- RDM ODBC API Reference 100

101 SQL_INVALID_HANDLE DiagField to retrieve additional information, raima database manager error. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField, raima database manager error. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLGetFunctions. RDM ODBC API Reference 101

102 SQLGetInfo Returns general information about the driver and data source associated with a connection. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetInfo( SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValuePtr, SQLSMALLINT BufferLength, SQLSMALLINT * StringLengthPtr) Arguments ConnectionHandle (input) Connection handle. InfoType (input) Type of information. InfoValuePtr (output) Pointer to a buffer in which to return the information, raima database manager error. Depending on the InfoType requested, the information returned will be one of the following: a null-terminated character string, an SQLUSMALLINT value, an SQLUINTEGER bitmask, an SQLUINTEGER flag, or a SQLUINTEGER binary value. If the InfoType argument is SQL_DRIVER_HDESC or SQL_DRIVER_HSTMT, the InfoValuePtr argument is both input and output. (See the SQL_DRIVER_ HDESC or SQL_DRIVER_HSTMT descriptors later in this function description for more information.) If InfoValuePtr is NULL, StringLengthPtr will still return the total number of bytes (excluding the null-termination character for character data) available to return in the buffer pointed to by InfoValuePtr. BufferLength (input) Length of the *InfoValuePtr buffer, raima database manager error. If the value in *InfoValuePtr is not a character string or if InfoValuePtr is a null pointer,the BufferLength argument is ignored. The driver assumes that the size of *InfoValuePtr is SQLUS- MALLINT or SQLUINTEGER, based on the InfoType. StringLengthPtr (output) Pointer to a buffer in which to return the total number of bytes (excluding the null-termination character for character data) available to return in *InfoValuePtr. For character data, if the number of bytes available to return is greater than or equal to BufferLength, the information in *InfoValuePtr is truncated to BufferLength bytes minus the length of a null-termination character and is null-terminated by the driver. For all other types of data, the value of BufferLength is ignored and the driver assumes the size of *InfoValuePtr is SQLUSMALLINT or SQLUINTEGER, raima database manager error, depending on the InfoType. RDM ODBC API Reference 102

103 Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error, raima database manager error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLGetInfo. RDM ODBC API Reference 103

104 SQLGetStmtAttr Returns the current setting of a statement attribute. Conformance Version Introduced: ODBC 3.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetStmtAttr( SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER BufferLength, SQLINTEGER * StringLengthPtr) Arguments StatementHandle (input) Statement handle. Attribute (input) Attribute to retrieve, raima database manager error. ValuePtr (output) Pointer to a buffer in which to return the value of the attribute specified in Attribute. If ValuePtr is NULL, StringLengthPtr will still return the total number of bytes (excluding the null-termination character for character data) available to return in the buffer pointed to by ValuePtr. BufferLength (input) If Attribute is an ODBC-defined attribute and ValuePtr points to a character string or a binary buffer, this argument should be the length of *ValuePtr. If Attribute is an ODBC-defined attribute and *ValuePtr is an integer, BufferLength is ignored StringLengthPtr (output) A pointer to a buffer in which to return the total number of bytes (excluding the nulltermination character) available to return in *ValuePtr. If ValuePtr is a null pointer, no length is returned. If the attribute value is a character string, and the number of bytes available to return is greater than or equal to BufferLength; the data in *ValuePtr is truncated to BufferLength minus the length of a null-termination character and is null-terminated by the driver. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. RDM ODBC API Reference 104

105 Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning), raima database manager error. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Comments The attributes accepted by SQLGetStmtAttr are listed under SQLSetStmtAttr. For more information, reference MSDN documentation for SQLGetStmtAttr. RDM ODBC API Reference 105

106 SQLGetTypeInfo Returns information about data types supported by the data source. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLGetTypeInfo( SQLHSTMT StatementHandle, SQLSMALLINT Raima database manager error Arguments StatementHandle (input) Statement handle. DataType (input) The SQL data type. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- RDM ODBC API Reference 106

107 DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLGetTypeInfo. RDM ODBC API Reference 107

108 SQLMoreResults Determines whether more results are available on a statement containing SELECT, UPDATE, INSERT, raima database manager error, or DELETE statements and, if so, initializes processing for those results. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLMoreResults( SQLHSTMT StatementHandle) Raima database manager error StatementHandle (input) Statement handle. Required Headers #include "sqlext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null RDM ODBC API Reference 108

109 SQL_NO_DATA pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. No more data was available. The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. For more information, reference MSDN documentation for SQLMoreResults. RDM ODBC API Reference 109

110 SQLNativeSql Returns the SQL string as modified by the driver. SQLNativeSql does canon asf cam sensor error execute the SQL statement. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLNativeSql( SQLHDBC ConnectionHandle, const SQLCHAR * InStatementText, SQLINTEGER TextLength1, SQLCHAR * OutStatementText, SQLINTEGER BufferLength, SQLINTEGER * Pci irq routing table error asrock Arguments ConnectionHandle (input) Connection handle. InStatementText (input) SQL text string to be translated. TextLength1 (input) Length in characters of *InStatementText text string. OutStatementText (output) Pointer to a buffer in which to return the translated SQL string. If OutStatementText is NULL, TextLength2Ptr will still return the total number of characters (excluding the null-termination character for character data) available to return in the buffer pointed to by OutStatementText. BufferLength (input) Number of characters in the *OutStatementText buffer. TextLength2 (output) Pointer to a buffer in which to return the total number of characters (excluding null-termination) available to return in *OutStatementText. If the number of characters available to return is greater than or equal to BufferLength, the translated SQL string in *OutStatementText is truncated to BufferLength minus the length of a null-termination character. Required Headers #include "sqlext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. RDM ODBC API Reference 110

111 Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLNativeSql. RDM ODBC API Reference 111

112 SQLNumParams Determines the number of parameters in a prepared statement Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLNumParams( SQLHSTMT StatementHandle, SQLSMALLINT * ParameterCountPtr) Arguments StatementHandle (input) Statement handle. ParameterCountPtr (output) Pointer to a buffer in which to return the number of parameters in the statement. Required Headers #include "sqlext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- RDM ODBC API Reference 112

113 DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLNumParams. RDM ODBC API Reference 113

114 SQLNumResultCols Returns the number of columns in a result set, raima database manager error. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLNumResultCols( SQLHSTMT StatementHandle, SQLSMALLINT * ColumnCountPtr) Arguments StatementHandle (input) Statement handle. ColumnCountPtr (output) Pointer to a buffer in which to return the number of columns in the result set, raima database manager error. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly raima database manager error a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- RDM ODBC API Reference 114

115 DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLNumResultsCol. RDM ODBC API Reference 115

116 SQLParamData SQLParamData is used together with SQLPutData to supply parameter data at statement execution time, and with SQLGetData raima database manager error retrieve streamed output parameter data. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLParamData( SQLHSTMT StatementHandle, SQLPOINTER * ValuePtrPtr) Arguments Warning error on line php sablotron (input) Statement handle. ValuePtrPtr (output) Pointer to a buffer in which to return the address of the ParameterValuePtr buffer specified in SQLBindParameter (for parameter data) or the address of the TargetValuePtr buffer specified in SQLBindCol (for column data), as contained in the SQL_DESC_DATA_PTR descriptor record field. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any out- RDM ODBC API Reference 116

117 SQL_INVALID_HANDLE put arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. For more information, reference MSDN documentation for SQLParamData. RDM ODBC API Reference 117

118 SQLPrepare Prepares an SQL string for execution. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLPrepare( SQLHSTMT StatementHandle, SQLCHAR * StatementText, SQLINTEGER TextLength); Arguments StatementHandle (input) Statement handle. StatementText (input) SQL text string. TextLength (input) Length of *StatementText in characters. Required Headers #include "sql.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or RDM ODBC API Reference 118

119 For more information, reference MSDN documentation for SQLPrepare. descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. RDM ODBC API Reference 119

120 SQLPrimaryKeys Returns the column names that make up the primary key for a table. The driver returns the information as a result set. This function does not support returning primary keys from multiple tables in a single call. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLPrimaryKeys( SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * TableName, SQLSMALLINT NameLength3); Arguments StatementHandle (input) Statement handle. CatalogName (input) Catalog name. CatalogName cannot contain a string search pattern. NameLength1 (input) Length in characters of *CatalogName. SchemaName (input) Schema name. SchemaName cannot contain a string search pattern. NameLength2 (input) Length in characters of *SchemaName. TableName (input) Table name. This argument cannot be a null pointer. TableName cannot contain a string search pattern. NameLength3 (input) Length in characters of *TableName. Required Headers #include "sqlext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code RDM ODBC API Reference 120

121 SQL_SUCCESS SQL_SUCCESS_WITH_INFO SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- Raima database manager error to raima database manager error additional information from the header record, raima database manager error. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection handle. Comments SQLPrimaryKeys returns the information that pertains to the databases that are currently open. If no database is open on the data source, SQLPrimaryKeys returns an empty result set. For more information, reference MSDN documentation for SQLPrimaryKeys. RDM ODBC API Reference 121

122 SQLProcedureColumns Returns the parameter and column information about the specified procedures. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLProcedureColumns( SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, Raima database manager error * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * ProcName, SQLSMALLINT NameLength3, SQLCHAR * ColumnName, SQLSMALLINT NameLength4); Arguments StatementHandle (input) Statement handle. CatalogName (input) Procedure catalog name. CatalogName cannot contain a string search pattern. NameLength1 (input) Length in characters of *CatalogName, raima database manager error. SchemaName (input) String search pattern for procedure schema names. NameLength2 (input) Length in characters of *SchemaName. ProcName (input) String search pattern for procedure names. NameLength3 (input) Length in characters of *ProcName. ColumnName (input) String search pattern for column names. NameLength4 (input) Length in characters of *ColumnName. Required Headers #include "sqlext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. RDM ODBC API Reference 122

123 Returns Return Code SQL_SUCCESS Raima database manager error SQL_ERROR SQL_INVALID_HANDLE Function completed successfully. The application calls SQLGet- DiagField to retrieve additional information from the header record. Function completed successfully, possibly with a nonfatal error (warning). The application calls SQLGetDiagRec or SQLGetDiagField to retrieve additional information. Function failed. The application calls SQLGetDiagRec or SQLGet- DiagField to retrieve additional information. The contents of any output arguments to the function are undefined. Function failed due to an invalid environment, connection, statement, or descriptor handle. This indicates a programming error. No additional information is available from SQLGetDiagRec or SQLGet- DiagField. This code is returned only when the handle is a null pointer or is the wrong type, such as when a statement handle is passed for an argument that requires a connection cpu fan error checking nvram. Comments SQLProcedureColumns returns the information that pertains to the databases that are currently open. If no database is open on the data source, SQLProcedureColumns returns an empty result set. For more information, reference MSDN documentation for SQLProcedureColumns. RDM ODBC API Reference 123

124 SQLProcedures Returns the list of procedure names stored in a specific data source. Procedure is a raima database manager error term used to describe an executable object, or a named entity that can be invoked using input and output parameters. Conformance Version Introduced: ODBC 1.0 Standards Compliance: ISO 92 Syntax SQLRETURN SQLProcedures( SQLHSTMT StatementHandle, SQLCHAR * CatalogName, SQLSMALLINT NameLength1, SQLCHAR * SchemaName, SQLSMALLINT NameLength2, SQLCHAR * ProcName, SQLSMALLINT NameLength3); Arguments StatementHandle (input) Statement handle. CatalogName (input) Procedure catalog. NameLength1 (input) Length in characters of *CatalogName, raima database manager error. SchemaName (input) String search pattern for procedure schema names. NameLength2 (input) Length in characters of *SchemaName, raima database manager error. ProcName (input) String search pattern for procedure names. NameLength3 (input) Length in characters of *ProcName. Required Headers #include "sqlext.h" Libraries Library Name rdmrdbc11 RDM ODBC API Library See Library Naming Conventions section for full library name and a list of library dependencies. Returns Return Code SQL_SUCCESS Function completed successfully, raima database manager error. The application calls SQLGet- RDM ODBC API Reference 124

125

Raima Database Manager 11.0 - TFS Configuration and Extension API Guide TFS Configuration and Extension API Guide

Raima Database Manager 11.0 - TFS Configuration and Extension API Guide TFS Configuration and Extension API Guide
TFS Configuration and Extension API Guide Raima Database Manager 11.0 TFS Configuration and Extension API Guide 1
Raima Database Manager 11.0 - TFS Configuration and Extension API Guide TFS Configuration and Extension API Guide
TFS Configuration and Extension API Guide Trademarks Raima Database Manager® (RDM®), raima database manager error, RDM Embedded® and RDM Server® are trademarks of Raima Inc. and may be registered in the United States of America and/or other countries. All other names may be trademarks of their respective owners. Raima database manager error guide may contain links to third-party Web sites that are not under the control of Raima Inc. and Raima Inc. is not responsible for the content on any linked site. If you access a third-party Web site mentioned in this guide, you do so at your own risk. Inclusion of any links does not imply Raima Inc. endorsement or acceptance of the content of those third-party sites. raima database manager error 2
Raima Database Manager 11.0 - TFS Configuration and Extension API Guide TFS Configuration and Extension API Guide
Raima Database Manager 11.0 - TFS Configuration and Extension API Guide TFS Configuration and Extension API Guide
TFS Configuration and Extension API Guide d_tfsIterateConnectedUsers 52 d_tfsrun 55 d_tfsstop 57 d_tfsterm 59 d_tfsversion 61 d_tfsxapiparams 63 Glossary 67 Index 78 Contents 4
Raima Database Manager 11.0 - TFS Configuration and Extension API Guide TFS Configuration and Extension API Guide
TFS Configuration and Extension API Guide Introduction RDM's Transactional File Server (TFS), in addition to controlling database access from runtime libraries, is also a simple HTTP server. This means that the TFS is prepared to service the RPCs from runtimes, and also GET and POST messages sent from a HTTP client. The first implication of this capability is that the TFS can serve HTML pages, contained in files, to HTTP clients. This can be a convenient way to share information from the TFS host computer without needing to run a full HTTP server. The RDM TFS may also be extended such that a programmer can create functions that are linked into the TFS and are accessible from HTTP clients through standard URLs. These functions may do anything within the TFS environment, including accessing databases. This means that an RDM developer has the ability to customize the TFS, adding functionality that can be accessed through programs or through standard HTTP clients. Unmodified, the TFS services runtime RPCs and HTML file requests. Modified by a programmer, the TFS can recognize additional URLs with parameter strings that are passed to Extension API functions. An additional ability to select a configuration will be described in this section. Application systems can be con- structed that have a client/server architecture or an in-process architecture. Hybrids can be constructed to suite specific needs. The following section describes the configuration options. Introduction 5
Raima Database Manager 11.0 - TFS Configuration and Extension API Guide <i>Raima database manager error</i> Configuration and Extension API Guide
TFS Configuration and Extension API Guide TFS Server Configurations Introduction The TFS functionality is accessed through an API. This API is reentrant, so that its functions may be accessed by multiple threads concurrently. Anything that can be done with a database is done through the TFS API. The runtime library is linked into an application's program space, and performs caching of database pages and manipulations of those page contents in order to implement database queries and updates. The application uses the runtime's API, sometimes referred to as the "d_" API. To obtain a page from a database, the runtime must call a TFS API function. To lock a record or set type, a TFS API function is called, raima database manager error. To perform an update to the database (transaction), a series of TFS API's are called. The location and invocation of TFS functions is configurable. The normal configuration is to have the TFS API directly linked into the application program. However, the TFS can be available through a multi- threaded TFS Server. This is what the tfserver utility is, where applications linked with runtimes remotely access TFS functions through a server, running in a different process. A third configuration, discussed below, is a single-process, single-thread application. This special situation does- n't require much of the TFS functionality, and a special compact TFS is available raima database manager error this situation. The TFS Configuration types listed below are enumerated types used by d_tfsinitEx and rsqlTFSIn- itEx. TFS Configuration Types TFS_TYPE_DEFAULT Factory default TFS type is TFS_TYPE_TFS. TFS_TYPE_TFS See Direct-Link Configuration TFS_TYPE_RPC See Standard Client/Server Configuration TFS_TYPE_STANDALONE See Standalone Configuration If a TFS type is not specified, the default TFS type will be used by functions d_tfsinit, raima database manager error, rsqlTFSinit and d_opentask. Installations with source code can change this default. Direct-Link Configuration If an application does not require a separate server, it is possible to link the TFS API with the application to make it run in-process. Because the TFS functions are reentrant, this application may be multi-threaded. Figure 14-2 shows this configuration. TFS Server Configurations game guard error 150 6
Raima Database Manager 11.0 - TFS Configuration and Extension API Guide TFS Configuration and Extension API Guide
TFS Configuration and Extension API Guide Fig. 14-2. Direct-Link Configuration An obvious benefit of this configuration is that the calls from the runtime to the TFS have no intermediate mar- shalling/demarshalling or TCP/IP send and receive, so this application should perform better than the same appli- cation raima database manager error the client/server configuration. Note that since the RPC mechanism in the client/server configuration makes the TFS functions look local, there are no changes required to the application or runtime library to make them work in either configuration. TFS Server Configurations 7
TFS Configuration and Extension API Guide Now note the similarity between the TFS Server Process in Figure 14-1 and the Application Program in Figure 14-2. The only difference between the Server Program and Application Program is that the Server Program starts up threads that exist to service connections with other runtimes and call TFS stub functions. The Appli- cation Program threads can exist side-by-side with the server connection threads, and an Application Program has the ability to start them up if it chooses. If it starts up connection threads, then it is acting as a TFS to other applications that are configured to run in the client/server configuration. Figure 14-3 attempts to illustrate this con- figuration, which is a combination of direct-link and client/server. Fig. 14-3. Hybrid Direct-Link, Client/Server Configuration TFS Server Configurations 8
TFS Configuration and Extension API Guide By starting up the server connection threads, the application is allowing other applications to have access to the databases that are under the control of this TFS (application). The code below shows the necessary code to start up the server connection threads. TFS_HANDLE hTFS; /* handle to control TFS server connection threads */ char *docroot = "c:/RDM/databases"; /* should be command-line option */ int32_t rc; ., raima database manager error. if ((rc = d_tfsinit(docroot, NULL, &hTFS)) != S_OKAY) error_exit(rc); if ((rc = d_tfsrun(hTFS, TRUE, NULL)) != S_OKAY) error_exit(rc); /* begin Application code */ . /* Application termination */ if ((rc = d_tfsstop(hTFS)) == S_OKAY) /* stop the server threads */ d_tfsterm(hTFS); /* free resources */ It is possible to set the configuration programmatically through the use of the d_tfsinitex(.) function with one of the following three parameters: TFS_TYPE_TFS, TFS_TYPE_STANDALONE, or TFS_TYPE_RPC as follows: Direct-Link Configuration (TFST): This configuration runs the TFS engine within your application, and the database is stored there. The TFST con- figuration is ACID compliant. Optionally, the ability to accept remote connections (set in raima database manager error applications as clients using TFS_TYPE_RPC) can also be enabled, allowing your application to act as a server to other users. TFS_HANDLE hTFS; TFS_PARAMS tparams; tparams.port= 21553; tparams.rd_only= FALSE; tparams.no_disk= FALSE; tparams.verbose= FALSE; tparams.logfile= NULL; tparams.stdout_file= NULL; /* start Direct-Link TFS configuration */ sStatus= d_tfsinitEx ("/my/directory", &tparams, &hTFS, TFS_TYPE_TFS); if (sStatus == S_OKAY) { DB_TASK *task; d_opentask (&task); . d_closetask (task); TFS Server Configurations 9
TFS Configuration and Extension API Guide d_tfsterm (hTFS); } Client-Server Configuration (TFSR) This configuration does not run any TFS engine in your application, requiring it to connect to a TFS (either tfserver or another application in TFST configuration) hosting the database over TCP/IP. This configuration is also ACID compliant. TFS_HANDLE hTFS; TFS_PARAMS tparams; tparams.port= 21553; tparams.rd_only= FALSE; vba application-defined or object-defined error 1004 tparams.no_disk= FALSE; tparams.verbose= FALSE; tparams.logfile= NULL; tparams.stdout_file= NULL; /* start Direct-Link TFS configuration */ sStatus= d_tfsinitEx (NULL, &tparams, &hTFS, TFS_TYPE_RPC); if (sStatus == S_OKAY) { DB_TASK *task; d_opentask (&task); . d_closetask (task); d_tfsterm (hTFS); } Standalone Configuration (TFSS) This configuration runs a TFS engine within your application, however it is not multi-user capable (and therefore cannot accept incoming connections), and is not ACID raima database manager error. It is very fast however, and is useful for sit- uations where complete safety is not required. TFS_HANDLE hTFS; TFS_PARAMS tparams; tparams.port= 21553; tparams.rd_only= FALSE; tparams.no_disk= FALSE; tparams.verbose= FALSE; tparams.logfile= NULL; tparams.stdout_file= NULL; /* start Direct-Link TFS configuration */ TFS Server Configurations 10
TFS Configuration and Extension API Guide sStatus= d_tfsinitEx ("/my/directory", &tparams, &hTFS, TFS_TYPE_STANDALONE); if (sStatus == S_OKAY) { DB_TASK *task; d_opentask (&task); . d_closetask (task); raima database manager error d_tfsterm (hTFS); } This hybrid configuration may involve application programs that are all identical (i.e. there is one designated to raima database manager error the server, and others are clients), or the server program may be unique while client programs are different. An additional function exists to inform a program of the configuration in which it is running, in case there is different program logic involved, or if it is an error condition. This is shown by example below. uint16_t major; /* RDM major version number */ uint16_t minor; /* RDM minor version number */ TFS_LIB_TYPE type; /* TFS Library type */ . d_tfsversion(&major, &minor, &type); switch (type) { case TFS_LIB_TYPE_TFS: /* this program is direct-linked to the TFS library */ steam error 55 f1 2012 . break; case TFS_LIB_TYPE_RPC: /* this program is linked as a client to the server, using RPCs */ . break; case TFS_LIB_TYPE_STANDALONE: /* this program is linked to the standalone TFS library */ /* only one thread may access the database functions */ . break; } Note that there are two library types where starting up server connection threads does not make sense (TYPE_ RPC and TYPE_STANDALONE), but in these libraries, the d_tfsinit, d_tfsrun, d_tfsstop and d_ tfsterm functions simply return successfully, so there is no need to build an application in two ways if it is intended for two configurations. In fact, the TYPE_STANDALONE configuration requires the use of the d_ tfsinit function to establish a root directory for raima database manager error databases (if not always the current directory). Standard Client/Server Configuration The runtimes and TFS are running within different processes. The runtimes invoke the TFS functions through a Remote Procedure Call (RPC) mechanism, as shown in Figure 14-1 below. TFS Server Configurations raima database manager error sql server error 17189 11
TFS Configuration and Extension API Guide raima database manager error Fig. 14-1. Standard Client/Server Configuration In the client/server configuration, any number of runtimes can be connected to the TFS process. If an application program is multi-threaded, each thread can establish a connection with the server. For each runtime connection, the server will spawn a thread to service the RPCs from that thread for the duration of the thread's activity. In this client/server configuration, the application process may be on the same computer as the server process, or a different one. The TFS proxies that are linked into the application process "act like" the actual TFS API functions. The proxies will marshal the input parameters and send them in a packet to the server. The server will determine, from the contents of the packet, which function is being called, and will call the corresponding stub function. The stub func- tion will interpret the marshaled parameter values and then call the real TFS function with those parameter values. Upon return from the function, there may be output parameters and a return code. These are all mar- shaled into a packet that is returned to the client, where the values are demarshaled and returned to the appli- cation. Again, the application, calling a TFS API function, does not know that the actual function was not local. Standalone Configuration The standalone configuration uses a version of the TFS API that assumes that only one thread within one proc- ess will be calling the functions. With this assumption, a number of simplifications can be made: TFS Server Configurations 12
TFS Configuration and Extension API Guide l The program has exclusive access to all databases, even when opening them in shared mode. So all lock- ing functions are accepted, but have no effect. l No changes are ever made by other runtimes, so the cache need not be flushed, and the TFS need not keep a store of the modified pages. l Read-only-transactions don't require jozef end error cache versioning because no other runtimes are making changes. NOTE: The implementation of transactions in the standalone configuration leaves a database vul- nerable to corruption if there is an interruption of the program's processing during the commit of a trans- action, or if the computer or operating system crash before the database files are closed. It is not recommended that this configuration be used in unstable environments. raima database manager error All of the above differences amount to an extremely high-performing raima database manager error. If this configuration satisfies an application's requirements, raima database manager error, it is preferable to the others. The figure below illustrates the standalone configuration, raima database manager error. Fig. 14-4. Standalone Configuration TFS Server Configurations 13
TFS Configuration and Extension API Guide raima database manager error TFS Configuration Settings Aspects of the raima database manager error environment of RDM can be configured using a configuration file, or programmatically through the API. The TFS environment can be configured using configuration files, raima database manager error, through environment var- iables, or on utility command-lines. Variables set in the environment take precedence over variables set in the configuration file variables set programmatically, or on a command-line will take the highest precedence. The TFS configuration affects the behavior of the TFS (tfserver) and the other utilities that have direct access to the files in the document root. There is a global configuration file, tfs.ini, kept in the document root of the TFS, that applies to all databases stored within the document root, raima database manager error. Each database may also have its own con- figuration file for database specific settings related to mirroring and replication, raima database manager error. These parameters affect the databases regardless of the property name settings of the runtimes, since TFS configuration properties must apply to all users of the databases. The tfs.ini and dbname.ini files may contain the same property name/value pairs, and the database-spe- cific file has priority. The priority of the property name values are as follows: l If the dbname/dbname.ini exists, and if the property name is specified, use this value, l Else if tfs.ini exists, and if the property name is specified, use this value, l Else use the default value (shown below). The following example shows the potential placement of configuration files: c:\RDM\databases tfs.ini phlist\ phlist.ini . (other database files) tfs.corporate.com-21553\ phlist\ . (other database files) mkt\ . (other database files) tims\ tims.ini . (other database files) This example shows two databases that have their own configuration files, phlist and tims. Two databases have none, tfs.corporate.com-21553/phlist and mkt. Since there is a tfs.ini file in the document root, any property names that do not exist in the database directories will be obtained from this file. Environment Variables Variable Name Description RDM_DOCROOT In the absence of a command-line specification of the document root (-d option), tell tfserver, dbmirror, dbrep or dbrepsql to use this directory instead of the current directory for the document root. TFS Configuration Settings 14
TFS Configuration and Extension API Guide Variable Name Description RDM_TFSERVER In the absence of a command-line specification of the host name and port number the run- time can locate the TFS to connect to using the contents of this variable: RDM_TFSERVER=localhost:21553 Configuration File (tfs.ini, dbname.ini) The RDM TFS configuration file follows the standard formatting for INI text files (See Wikipedia). An INI file can hold a number of sections, each section consist of raima database manager error section name enclosed in bracket followed by a number of properties. Each property consists of a name followed by an equal sign and a value. A semicolon marks the beginning of a comment that continues to the end of the line. Section names and variable names will be case insensitive, raima database manager error. Unrecognized section names and properties as well as properties appearing in the wrong sections will be ignored by the system. Only two sections, [configuration] and [LogCleanup], are used by the TFS, raima database manager error. The function d_dbsetini has been provided to set the database-specific values when a database is open in exclu- sive mode. To programmatically set the tfs.ini values, you must use the psp_iniSet function, raima database manager error. Since the configuration files are simple text files, it is possible to create and edit them with common text editors. Update access to the document root is required. The currently supported properties and associated section names are located in the table below. [configuration] ; The following settings are only read from tfs.ini and apply to all databases ; Maximum number of users connected to the TFS, between 16 and 1000, raima database manager error, defaults to 256 maxusers=256 ; Maximum number of files per database, between 16 and 65535, defaults to 4096 maxfiles=4096 ; The following settings can appear in either tfs.ini or dbname.ini raima database manager error ; Set to 1 (on) to enable sorting based on system locale, raima database manager error, default is 0 (off). use_string_locale=0 ; Set to 0 (off) to disable file syncing to disk. This will improve per- formance ; but at a risk of data loss. Default is 1 (on). synclogfiles=1 ; Specify the type of compression to be used for log files. ; Compression types: ; none : No compression TFS Configuration Settings raima database manager error 15
TFS Configuration and Extension API Guide ; zero : Compress zeros (default) logfile_compression=zero ; Enable replication. 0=off (default) and 1=on. Enabling this property ; will cause the runtime to generate replication log files for use ; in a replicated environment. replication=0 ; Enable mirroring. 0=off (default) and 1=on. Enabling this property ; will cause the TFS to generate mirroring log files for use ; in a mirrored environment. mirroring=0 ; The number of milliseconds delay between checkpoint operations for a ; database (default is 1000 ms for disk based databases and 100 ms for ; in memory databases). checkpoint_frequency=1000 ; Set to 0 to disable single slave mode, when you have more than one ; slave connected to a single master, raima database manager error. Single slave mode optimizes ; log file cleanup when there is only one slave. This option is enabled by default ; and will automatically be disabled if a second slave is detected. SingleSlaveMode=1 [LogCleanup] ; LogCleanup settings are used to specify when log files can be removed to ; prevent the disk from filling up during the mirroring or replication activ- ity. ; LogFileAge specifies when a log file can be removed base on file date and time. ; If the log file's age is greater than the specified value, it will be removed, raima database manager error. ; Values can be specified as s (seconds), m (minutes), h (hours), d (days). ; Care should be used when specifying a value in seconds as a value too small ; may cause log files to be cleaned up before they have a chance to mirror to the slave. ; (examples: 30s
Answer

Hi srob44,


The issue seems to be related to a third party program (Raima database manager). I would suggest you to contact the manufacturer support for further assistance on the issue -

http://www.raima.com/support/

 

Hope this helps.

Thanks, raima database manager error Meghmala – Microsoft Support

Report abuse

Harassment is any behavior intended to disturb or upset a person or group of people. Threats include any threat of suicide, raima database manager error, violence, or harm to another. raima database manager error Any content of an adult theme or inappropriate to a community web site. Any image, link, or discussion of nudity. Any behavior that is insulting, rude, raima database manager error, vulgar, desecrating, or showing disrespect. Any behavior that appears to violate End user license agreements, including providing product keys or links to pirated software. Unsolicited bulk mail or bulk advertising. Any link to or advocacy of virus, spyware, malware, or phishing sites. Any other inappropriate content or behavior as defined by the Terms of Use or Code of Conduct. Any image, link, or discussion related to child pornography, child nudity, or other raima database manager error abuse or exploitation. raima database manager error
Details (required):
250 characters remaining

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Desigo CC V4.1 - Database Manager Blocked

Joined: 9/21/2020

Last visit: 11/24/2021

Posts: 39

Rating:

(8)

 Hi,

have you checked this case with windows firewall off?

Maybe you need to add rules for  managed ports for windows firewall?

Hi,

We have a project with CC V4.1 (4.0.121.104), where the database manager is blocked every while. I checked the tracer and found the following error: 

   " WCCILdata    (0), raima database manager error, 2021.07.01 10:52:21.445, SYS,  SEVERE,     69, Database error, raima database manager error, AlertCacheItem, flush, Code :101

GmsDevice_1_2098180_12.Alarm.Fault:_alert_hdl._value (Type: 0 Sys: 0 Dp: 517433 El: 38 : _alert_hdl._value)
TIME_VAR 196608 Thu Jul  1 09:32:02 2021 000
WCCILdata    (0), 2021.07.01 10:52:21.446, SYS,  SEVERE,     69, Database error, DataManTask, dbError, RAIMA Database Error *** Code:-909 (SYSTEM/OS error: -909
file record limit exceeded
FILE: D:\workspaces\workspace\ExternLibs\rdm45\runtime\Dio.c(2096))
WCCILdata    (0), 2021.07.01 10:52:21.446, SYS,  SEVERE,     69, Database error, StAHVariableUtils, storeVariable-909
WCCILdata    (0), 2021.07.01 10:52:21.446, SYS,  SEVERE,    118, Last error already repeated 50 times. Until another output occurs, this one will be blocked.
WCCILdata    (0), 2021.07.01 10:52:26.639, SYS,  SEVERE,     69, Database error, AlertCacheItem, flush, Code :101
GmsDevice_1_2098206_4194305.Alarm.Fault:_alert_hdl._value (Type: 0 Sys: 0 Dp: 631277 El: 41 : _alert_hdl._value)
TIME_VAR 196608 Thu Jul  1 11:45:27 2021 000
WCCILdata    (0), 2021.07.01 10:52:29.629, SYS,  INFO,      119, Last error repeated 2553 times "

Can you please advise about this error and what should we do to solve it?

Best regards, 

 

0 Comments

Leave a Comment