HP NonStop Open System Services ODBC/MX Client Driver for SQL/MX Release 3.2.1 HP Part Number: 691125-003 Published: March 2013 Edition: J06.15 and subsequent J-series RVUs; H06.
© Copyright 2013 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice.
Contents About This Manual........................................................................................5 Product Version........................................................................................................................5 Supported Release Version Updates (RVUs)..................................................................................5 Document History.....................................................................................................................
SQL Scalar Functions..........................................................................................................36 CONVERT Function............................................................................................................38 ODBC Data Types..................................................................................................................38 Unsigned Data Types.........................................................................................................
About This Manual This manual describes how to install and configure the HP NonStop Open System Services (OSS) ODBC/MX Client Driver. This product enables applications developed for the OSS Open Database Connectivity (ODBC) application programming interface to use HP NonStop SQL/MX to access HP NonStop SQL databases on an HP NonStop system. Product Version HP NonStop OSS ODBC/MX 3.2.1 Supported Release Version Updates (RVUs) This manual supports J06.15 and all subsequent J-series RVUs and H06.
Programming Manuals SQL/MX Programming Manual for C and COBOL Describes how to embed SQL/MX statements in ANSI C and COBOL programs. SQL/MX Programming Manual for Java Describes how to embed SQL/MX statements in Java programs according to the SQLJ standard. Specialized Guides SQL/MX Installation and Upgrade Guide Describes how to plan for install and upgrade an SQL/MX database. SQL/MX Management Guide Describes how to manage an SQL/MX database.
Related SQL/MP Manuals SQL/MP Reference Manual Describes the SQL/MP language elements, expressions, predicates, functions, and statements. SQL/MP Installation and Management Guide Describes how to plan, install, create, and manage an SQL/MP database. Describes installation and management commands and SQL/MP catalogs and files.
New and Changed Information Changes to the 691125-003 manual: Changed the property name from SQL Interval Insertion to SQL Interval Behaviour across the document. Changes to the 691125-002 manual: • Added “Configuring OSS ODBC/MX driver to use IPV6” (page 25). • Updated the Table 2 (page 25) for Datetime Retrieval, Interval Behaviour, and IPV6. • Added “SQL Interval Behaviour property” (page 46). • Added “SQL Datetime Retrieval property” (page 48).
Notation Conventions Hypertext Links Blue underline is used to indicate a hypertext link within text. By clicking a passage of text with a blue underline, you are taken to the location described. General Syntax Notation This list summarizes the notation conventions for syntax presentation in this manual. UPPERCASE LETTERS Uppercase letters indicate keywords and reserved words. Type these items exactly as shown. Items not enclosed in brackets are required.
… Ellipsis An ellipsis immediately following a pair of brackets or braces indicates that you can repeat the enclosed sequence of syntax items any number of times. For example: M address [ , new-value ]… [ - ] {0|1|2|3|4|5|6|7|8|9}… An ellipsis immediately following a single syntax item indicates that you can repeat that syntax item any number of times. For example: “s-char” Punctuation Parentheses, commas, semicolons, and other symbols not previously described must be typed as shown.
error := FILE_GETINFO_ ( filenum , [ filename:maxlen ]) ; !i !o:i Notation for Messages This list summarizes the notation conventions for the presentation of displayed messages in this manual. Bold Text Bold text in an example indicates user input typed at the terminal. For example: ENTER RUN CODE ?123 CODE RECEIVED: 123.00 The user must press the Return key after typing the input. Nonitalic text Nonitalic letters, numbers, and punctuation indicate text that is displayed or returned exactly as shown.
P=% p-register E=% e-register Notation for Management Programming Interfaces This list summarizes the notation conventions used in the boxed descriptions of programmatic commands, event messages, and error lists in this manual. UPPERCASE LETTERS Uppercase letters indicate names from definition files. Type these names exactly as shown. For example: ZCOM-TKN-SUBJ-SERV lowercase letters Words in lowercase letters are words that are part of the notation, including Data Definition Language (DDL) keywords.
1 ODBC/MX Client Overview This chapter includes these sections: • “Client Components” (page 13) • “Data Source Configuration” (page 14) • “OSS ODBC/MX Client Driver Architecture” (page 14) • “Connections” (page 16) • “Object Naming and Mapping” (page 18) • “Release Considerations and Restrictions” (page 18) • “Traces” (page 20) • “Supported APIs” (page 20) • “Unsupported ODBC API Functions and Data Types” (page 21) • “OSS ODBC/MX Client Driver Features” (page 23) • Limitations of OSS OD
Data Source Configuration In OSS ODBC/MX Client Driver, the ODBCDSN file is used to specify the configuration details of data sources. The ODBCDSN file is an edit file that is available at the $SYSTEM.SYSTEM location. You can also save the ODBCDSN in the OSS location where the executable program is to be run. If you save the ODBCDSN file in the OSS location, it will take precedence over the ODBCDSN available at the $SYSTEM.SYSTEM location.
The SQL ODBC Applications interact with the OSS ODBC/MX Client Driver to communicate to the SQL/MX database. The ODBC server establishes a connection between the OSS ODBC/MX Client Driver and the SQL/MX database. The ODBC server interacts with the SQL/MX database, forwards the client requests to the database engine, and sends the responses to the OSS ODBC/MX Client Driver. The ODBC/MX APIs are directly exposed to the ODBC applications.
successful user authentication, the Association Server assigns one of the available servers to the user. If there are no more servers available, it returns an error. • If the data source is configured, but is not in a running state, the Association Server starts the MXOSRVR and replies to the OSS ODBC/MX Client Driver.
For more information on connecting to a data source, see the SQL/MX Connectivity Service Manual. Connection Mapping MXCS maps the client data source name in an incoming connection request to the server data source name (names are case sensitive). If the name matches but the server data source is not started, the connection request is rejected. If the server data source name does not exist, the Association Server routes the connection to the default data source.
Object Naming and Mapping ODBC/MX can access SQL database objects as follows: • with an alias, for SQL/MP objects that have an alias name (See ANSI Names for SQL/MP Objects). ANSI Name Type ODBC/MX supports only ANSI name types for NonStop SQL objects. Using the client interface at a client workstation, you can configure the default catalog and schema names used to qualify the table names in queries. The name format is as follows: catalog.schema.
Table 1 –1. Release Considerations and Restrictions (continued) and ODBC client from long running queries. If a query exceeds the specified time before the data source returns the result set, the OSS ODBC/MX Client Driver returns HYT00 (Timeout expired) to the ODBC client. SQLCancel Function In an ODBC 2.0 application when the query is not running, ODBC/MX implements the SQLCancel function as an SQLFreeStmt with the SQL_CLOSE option. If the query is running, ODBC/MX tries to stop the server.
Table 1 –1. Release Considerations and Restrictions (continued) SQL Catalog and Schema Names a table name. This applies for catalog API to SQLTables, SQLPrimaryKey, and SQLStatistics. This does not apply to SQLColumns. For information on migrating NonStop ODBC Server client applications to an ODBC/MX environment, see SQL/MX Comparison Guide for NonStop SQL/MP Users. Traces The OSS ODBC/MX Client Driver supports tracing facility. The trace information is captured in an OSS log file.
Unsupported ODBC API Functions and Data Types API Functions OSS ODBC/MX Client Driver 3.x does not support the following ODBC API functions. For descriptions of the ODBC API functions, see ODBC API Functions.
◦ ◦ SQLGetConfigMode • SQLBulkOperations • SQLFetchScroll - supported for SQL_FETCH_NEXT attribute only • SQLSetScrollOption Data Types This release of MXCS does not support the following ODBC data types. For more information about data types, see ODBC Data Types.
OSS ODBC/MX Client Driver Features The OSS ODBC/MX Client Driver 3.x supports the following features: • Row size limit is increased to align with maximum block size 32768 for MX tables. • A clustering key length up to 2048 bytes is allowed for range and hash partitioned MX tables. • The precision of the NUMERIC data type is extended up to 128 digits for signed and unsigned values. Limitations of OSS ODBC/MX Client Driver The system running an R 3.
2 Configuring Client Data Source Attributes for ODBC/MX Connectivity This chapter includes these sections: • “Accessing the ODBC/MX Data Source” (page 24) • “Configuring Data Sources” (page 24) • “Adding New Data Sources” (page 29) • “Modifying Data Sources” (page 29) • “Removing Data Sources” (page 29) • “Tracing OSS ODBC/MX Client Driver” (page 29) • “Components of the MX Connectivity Service” (page 30) • “Migration Considerations” (page 30) • “Accessing the ODBCDSN file through environme
For details on attributes and settings in the ODBCDSN file, see Table 4.2.1, Format of the ODBCDSN file, and, Example ODBCDSN file. 2. Move the ODBCDSN file to the $SYSTEM.SYSTEM folder. The OSS ODBC/MX driver first searches for the ODBCDSN file in the same OSS directory as the executable file of the process. If the ODBCDSN file is not available, the driver searches for it in $SYSTEM.SYSTEM. You can also save the ODBCDSN in the OSS location where the executable program is to be run.
Table 2 -1 describes the format of the ODBCDSN file. (continued) File Section Contents and Format executed. Trace file name is specified in the following format: TraceFile = file_name For example, if you specify the name of the trace file as Tracefile = trfetch, the system creates a file name as trfetch.6947088_1285815329. This file is located in the OSS location even if the ODBCDSN file is in the $SYSTEM.SYSTEM location. File Section TraceFlags Bitmask indicating trace level. For ODBC/MX 3.
Table 2 -1 describes the format of the ODBCDSN file. (continued) File Section Contents and Format SQLFractionValue If SQLFractionValue = 9, the fraction value of SQL_C_TIMESTAMP variable is considered to be nanoseconds. If SQLFractionValue is not specified or if it is SQL_DEFAULT or another value apart from 9, the fraction part of SQL_C_TIMESTAMP variables is considered to be microseconds.
Table 2 -1 describes the format of the ODBCDSN file. (continued) File Section Contents and Format Ipv6 File Section List of drivers. Currently, only one driver can be used. [DataSourceName] The driver name for each data source defined by DataSourceName in [ODBC Data Sources] must match the driver name defined by Driver in [DataSourceName]. Enables IPV6 address. To enable IPV6 in the OSS ODBC/MX driver, set Ipv6 to Enable.
[DS2] Description = Sample Data Source 2 Catalog = DS2CAT Schema = DS2SCH Server = TCP:172.31.41.214/61000 [DataSourceName] Driver = NonStop ODBC/MX Adding New Data Sources To add a new data source entry in the ODBCDSN file, include the data source name and its description. If the values of the parameters are not specified in the ODBCDSN file, the OSS ODBC/MX Client Driver uses default values for CATALOG (NONSTOP_SYSTEM_NSK) and SCHEMA, when creating a connection.
NOTE: To turn tracing on or off, modify the ODBCDSN file accordingly and restart the application. If tracing is enabled, the global trace flag is set and all the traceable ODBC data is logged into the trace file henceforth. The tracing parameters of the ODBCDSN file are: • [ODBC] parameter signifies the tracing support for ODBC. • TraceStart parameter determines whether the tracing facility is enabled or disabled. • TraceFlags parameter indicates the tracing level.
the file. The file name must be excluded from the specified path. Accessing the ODBCDSN file through environment variable enables you to access the file from a preferred location. Any error during the process causes the application to exit and the driver does not search any other directories. To make DSN_PATH part of your runtime environment, enter the following command: export DSN_PATH=/config/mydsn where /config/mydsn is the location of the ODBCDSN file excluding the file name.
3 ODBC/MX Conformance This chapter contains tables that describe the ODBC/MX conformance to standard ODBC API functions and SQL conformance levels. ODBC API Functions ODBC/MX conforms with the ODBC interface core level. The following tables show the ODBC/MX support for each ODBC API function. The column headed ODBC Version lists the version of the Microsoft ODBC standard in which a function was first introduced. For example, if ODBC Version 1.
Table 5 Setting and Retrieving Driver Attributes (continued) Function ODBC Version Supported by ODBC/MX Description SQLSetStmtAttr 3.x Yes Sets a statement attribute. Note: See the considerations under SQL_QUERY_TIMEOUT Option SQLGetStmtAttr 3.x Yes Returns the value of a statement attribute. Table 6 Setting and Retrieving Descriptor Fields Function ODBC Version Supported by ODBC/MX Description SQLSetDescField 1.0 Yes Prepares an SQL statement for later execution. SQLBindParameter 2.
Table 9 Retrieving Results and Information About Results Function ODBC Version Supported by ODBC/MX SQLRowCount 1.0 Yes Returns the number of rows affected by an insert, update, or delete request. SQLNumResultCols 1.0 Yes Returns the number of columns in the result set. SQLDescribeCol 1.0 Yes Describes a column in the result set. SQLColAttribute 1.0 Yes Describes the attributes of a column in a result set. SQLBindCol 1.
Table 10 Obtaining Information About a Data Source’s System (continued) Function ODBC Version Supported by ODBC/MX SQLSpecialColumns 1.0 Yes Returns information about the optimal set of columns that uniquely identifies a row in a specified table or the columns that are automatically updated when any value in the row is updated by a transaction. SQLStatistics 1.0 Yes Returns statistics about a single table and the list of indexes associated with the table.
• “SQL Interval Behaviour property” (page 46) • “SQL Datetime Retrieval property” (page 48) SQL Scalar Functions Table 13 Numeric Functions ODBC Function SQL/MX Equivalent Function ABS ABS ACOS ACOS ASIN ASIN ATAN ATAN ATAN2 ATAN2 CEILING CEILING COS COS COSH COSH COT Not supported in this release.
Table 14 String Functions (continued) ODBC Function SQL/MX Equivalent Function DIFFERENCE Not supported INSERT INSERT LCASE LOWER LEFT SUBSTRING LENGTH Supported, but no equivalent SQL/MX function. LOCATE LOCATE (ODBC LOCATE start parameter is not supported.) LTRIM TRIM...LEADING REPEAT REPEAT REPLACE REPLACE RIGHT RIGHT RTRIM TRIM...
Table 15 Time and Date Functions (continued) ODBC Function SQL/MX Equivalent Function SECOND SECOND TIMESTAMPADD Not supported TIMESTAMPDIFF Not supported WEEK WEEK Table 16 System Functions ODBC Function SQL/MX Equivalent Function DATABASE Not supported in this release. IFNULL Not supported in this release. USER USER CONVERT Function ODBC/MX uses the SQL/MX CAST function to support the ODBC CONVERT function.
Table 17 ODBC Data Types (continued) ODBC Data Type SQL/MX Data Type SQL/MP Data Type Supported by ODBC/MX BINARY(n) Not supported Not supported No VARBINARY(n) Not supported Not supported No LONG VARBINARY Not supported Not supported No DATE DATE DATE Yes TIME(p) TIME TIME Yes TIMESTAMP TIMESTAMP TIMESTAMP Yes INTERVAL MONTH(p) INTERVAL MONTH(p) Yes INTERVAL YEAR(p) INTERVAL YEAR(p) Yes INTERVAL YEAR(p) TO MONTH INTERVAL YEAR(p) TO MONTH Yes INTERVAL DAY(p) INTERVAL DA
Partial Date/Time Values • To use partial date/time values as parameters, provide values through the ODBC/MX data type returned. • To fetch partial date/time values follow table SQL/MP to ODBC/MX Date/Time Mappings on page 3-12. Partial date/time values fetched as character strings are returned as partial even when the driver returns a full date/time/timestamp data type. Default values are returned as a structure (1 for year/month/day, and 0 for hour/minute/second/fraction).
Microsoft Escape Clauses ODBC/MX accepts Microsoft escape clauses and translates them into equivalent SQL/MX clauses.
Timestamp Values with Fraction If a value of the SQLFractionValue property is not specified in the ODBCDSN file (or if it is equal to SYSTEM_DEFAULT or another value different from 9) and when a timestamp struct value is inserted from a C/C++ program into a column with type time or timestamp, the fraction field in the timestamp struct is considered in microseconds. If SQLFractionValue property is equal to 9, the timestamp struct is considered to be in nanoseconds.
Table 22 Sample Values Inserted From a C/C++ Program and Their Corresponding Expected Values in Microsecond (continued) Value Specified in the Fraction of the Client Program Column Type Expected Value in the Column of the SQL/MX Table 54 timestamp(2) or time(2) 0.00 4 timestamp(2) or time(2) 0.00 987654 timestamp(1) or time(1) 0.9 87654 timestamp(1) or time(1) 0.0 7654 timestamp(1) or time(1) 0.0 654 timestamp(1) or time(1) 0.0 54 timestamp(1) or time(1) 0.
Table 23 Sample Values Inserted From a C/C++ Program and Their Corresponding Expected Values in Nanosecond (continued) Value Specified in the Fraction of the Client Program Column Type Expected Value in Column of the SQL/MX Table 4321 timestamp(3) or time(3) 0.000 987654321 timestamp(2) or time(2) 0.98 87654321 timestamp(2) or time(2) 0.08 7654321 timestamp(2) or time(2) 0.00 654321 timestamp(2) or time(2) 0.00 54321 timestamp(2) or time(2) 0.00 4321 timestamp(2) or time(2) 0.
Table 24 SYSTEM_DEFAULT Values Retrieved Using a C/C++ Program (continued) Value in the Column of the SQL/MX Table Column Type Value in the Fraction of the Client Program 0.0000 timestamp(4) or time(4) 0 0.987 timestamp(3) or time(3) 987 0.087 timestamp(3) or time(3) 87 0.008 timestamp(3) or time(3) 8 0.000 timestamp(3) or time(3) 0 0.98 timestamp(2) or time(2) 98 0.09 timestamp(2) or time(2) 9 0.00 timestamp(2) or time(2) 0 0.9 timestamp(1) or time(1) 9 0.
Table 25 Sample Values Retrieved Using a C/C++ Program and Their Corresponding Expected Values in Nanosecond (continued) Value in the Column of the SQL/MX Table Column Type Value in the Fraction of the Client Program 0.087 timestamp(3) or time(3) 87000000 0.008 timestamp(3) or time(3) 8000000 0.000 timestamp(3) or time(3) 0 0.98 timestamp(2) or time(2) 980000000 0.09 timestamp(2) or time(2) 90000000 0.00 timestamp(2) or time(2) 0 0.9 timestamp(1) or time(1) 900000000 0.
Set the SQL Interval Behaviour property using the ODBCDSN property. • The following example describes when the value of SQL Interval Behaviour is set to SYSTEM_DEFAULT, the behavior of the driver is same as in earlier releases of SQL/MX.
SQL Datetime Retrieval property The SQL Datetime Retrieval specifies how the SQL/MP Datetime data type is retrieved from the ODBC/MX driver. The SQL Datetime Retrieval has two values: • SYSTEM_DEFAULT — Year is set to 0001. • MSDN_DEFAULT — Year is set to 1900. If not specified, the default is SYSTEM_DEFAULT. This property is applicable only when SQL/MP Datetime datatype is bound to SQL/MX datatypes such as DATE or TIMESTAMP. Set the SQL Datetime Retrieval property using the ODBCDSN property.
4 ODBC/MX Messages ODBC/MX Driver Error Codes To display the messages for the SQLSTATE numbers in the following table. ODBC/MX Client Messages Table 29 Error messages SQLSTATE Messages 01000 General Warning. 01000 General Warning. Connected to the default data source. 01002 Disconnect error. Transaction rolled back. 01004 Data truncated. 01006 Privilege not revoked. 01033 TRANSPORT LAYER ERROR. 01S02 Option value changed. 07001 Wrong number of parameters. 07003 Dynamic SQL error.
Table 29 Error messages (continued) 50 SQLSTATE Messages 08S01 Communication link failure. 08S02 TRANSPORT LAYER ERROR. 21001 Cardinality violation; insert value list does not match column list. 21002 Cardinality violation; insertion value list does not match column list. 21S01 Cardinality violation; parameter list does not match column list. 21S02 String data right truncation. 22001 Numeric value out of range. 22003 Error in assignment. 22005 Precision or scale out of range.
Table 29 Error messages (continued) SQLSTATE Messages S1000 General error. Failed since resource governing policy is hit. S1000 The stored procedure required to complete this operation could not be found on the server (they were supplied with the ODBC/MX setup disk for the SQL Server driver). Contact your service provider. S1000 Unknown token received from SQL Server S1000 Unable to load communication module. Driver has not been correctly installed. S1000 Communication module is not valid.
Table 29 Error messages (continued) 52 SQLSTATE Messages S1103 Direction option out of range. S1105 Invalid parameter type or parameter type not supported. S1106 Fetch type out of range. S1107 Row value out of range. S1108 Concurrency option out of range. S1109 Invalid cursor position; no keyset defined. S1C00 Driver not capable. S1LD0 No long data values pending. S1T00 Timeout expired. 6001 INVALID DLL HANDLE. 6002 CANNOT LOAD PROCADDRESS. 6003 WRONG WINSOCK VERSION.
A Sample ODBC Application Compilation and Linking of the Sample ODBC Application • Sample Application compilation step: Use the c89 compiler to compile the application with the header files that are shipped along with the OSS ODBC/MX Client Driver: OSS> c89 -o < output object name> -I/usr/include/odbc/ \ -c < input file for compilation> By default, the header files are located at the /usr/include/odbc/ directory. Example A-1.
-set systype oss -set FLOATTYPE IEEE_FLOAT -call_shared -set data_model lp64 \ -set highpin on -set highrequestor on \ -lcpp3 -lcppc -lcrtl -lcre -linet -lyputdll \ -l/yodbcdll /usr/lib/cmain64.o Thread_PUT_Test.o ThreadODBCTestAppl.o Execution and Testing of Sample ODBC Application To run the sample test application, issue any of the following commands on the OSS shell: OSS> ./ODBCTest OSS> .
Sample ODBC Application Code #include #include #include #include #include #define UnSignCharCast unsigned char * #define TRUE 1 typedef struct { SDWORD pfNativeError[1]; SWORD pcbErrorMsg[1]; SWORD cbErrorMsgMax; UCHAR *szErrorMsg; UCHAR *szSqlState; } ERR_INFO; RETCODE odbc_Error(SQLHENV hEnv, SQLHDBC hDbc, SQLHSTMT hStmt); RETCODE odbc_Error( SQLHENV hEnv, SQLHDBC hDbc, SQLHSTMT hStmt ) { char *szBuf; int pt_ch ='.
SQLHDBC hdbc2 = (SQLHDBC) NULL; SQLHSTMT hstmt = (SQLHSTMT) NULL; SQLHSTMT hstmt1 = (SQLHSTMT) NULL; CHAR CreateTable[100] = {'\0'}; CHAR InsertTable[100] = {'\0'}; CHAR SelectTable[100] = {'\0'}; int value; SQLINTEGER ValInd; SQLINTEGER RowCount = 0; SQLINTEGER val; SDWORD pcbValue = 0; SQLCHAR infoValueBuf[100] = {'\0'}; SQLCHAR*infoValuePtr=0; SQLSMALLINT StringLengthPtr = NULL; charPassword[40]="\0"; charUserID[40]="\0"; char *serverName="TDM_Default_DataSource"; shortvalue1=10; shortvalue2=20; booldefa
st = SQLAllocConnect(henv, &hdbc1); if (hdbc1 == NULL) { printf("Error in allocating connection Handle 2!\n"); odbc_Error(henv,SQL_NULL_HDBC,SQL_NULL_HSTMT); } st = SQLAllocConnect(henv, &hdbc2); if (hdbc2 == NULL) { printf("Error in allocating connection Handle 3!\n"); odbc_Error(henv,SQL_NULL_HDBC,SQL_NULL_HSTMT); } st = SQLConnect(hdbc,(SQLCHAR*)serverName,SQL_NTS,(SQLCHAR*)UserID,SQ L_NTS,(SQLCHAR*)Password,SQL_NTS); if (st != SQL_SUCCESS) { printf("Error in Connection 1\n"); odbc_Error(henv,hdbc,SQL_NU
odbc_Error(henv,hdbc,SQL_NULL_HSTMT); } st = SQLExecDirect(hstmt,(SQLCHAR *)CreateTable,strlen(CreateTable)); if ( st != SQL_SUCCESS) { printf("Error in Create Table: GGTest\n"); odbc_Error(henv,hdbc,hstmt); } else printf("Create tabel GGTest Successful\n"); st = SQLExecDirect(hstmt, (SQLCHAR *)InsertTable,strlen(InsertTable)); if (st != SQL_SUCCESS) { printf("Error in Insert Table 1: GGTest\n"); odbc_Error(henv,hdbc,hstmt); } else printf("Insert Succesfull: %d\n", value1); memset(InsertTable, '\0', sizeof(
} else { printf("c1 :: %d\n", value); }} // ***************** Done with connection 1 ******************** printf("\n\tUsing Connection 2\n\n"); st = SQLAllocHandle(SQL_HANDLE_STMT, (SQLHDBC)hdbc1, &hstmt1); if (hstmt1 == NULL) { printf("Error in allocating statement handle\n"); odbc_Error(SQL_NULL_HENV,SQL_NULL_HDBC,hstmt); } st = SQLPrepare(hstmt1,(SQLCHAR *)"insert into GGTest(c1) values(?)",SQL_NTS); if (st != SQL_SUCCESS) { printf("Error in SQLPrepare\n"); odbc_Error(henv,hdbc1,hstmt1); } st = SQLBindPa
else { printf("c1 :: %d\n", value); }} st = SQLExecDirect(hstmt1,(SQLCHAR*)"drop table GGTest",SQL_NTS); if (st != SQL_SUCCESS) { printf("Error in drop table : GGTest\n"); odbc_Error(henv,hdbc1,hstmt1); } else printf("\nTable GGTEST dropped!\n"); st = SQLEndTran(SQL_HANDLE_DBC,(SQLHANDLE)hdbc,SQL_ROLLBACK); if (hstmt) SQLFreeStmt(hstmt,SQL_CLOSE); if (hstmt1) SQLFreeStmt(hstmt,SQL_CLOSE); SQLDisconnect(hdbc); SQLFreeHandle(SQL_HANDLE_DBC, hdbc); SQLDisconnect(hdbc1); SQLFreeHandle(SQL_HANDLE_DBC, hdbc1); SQ
Glossary Table 30 Term Definition driver manager The OSS ODBC component that manages access to Database Management System (DBMS) drivers for ODBC applications. The driver manager loads and unloads drivers and passes calls for ODBC functions to the correct driver. Open Database Connectivity (ODBC) An interface specification for an API that defines a standard set of routines that an ODBC application can use to access data in a data source.
Index A ABS Function, 36 ACOS Function, 36 Alias names, adding, 18 ANSI name type, 18 API functions, ODBC supported, 32 unsupported, 21 architechture, 13 ASCII, 36 ASIN Function, 36 association server, functions of, 16 ATAN Function, 36 ATAN2 Function, 36 autocommit, 41 B BIGINT data type, 38 BINARY data type, 39 BIT data type, 38 C CAST function, 38 catalog restrictions, 18 CEILING function, 36 changes to documentation, 8 CHAR data type, 38 CHAR function, 36 client components of, 13 connecting to data so
MOD function, 36 MONTH function, 37 MONTHNAME, 37 N NOW function, 37 NUMERIC data type, 38 O OSS ODBC/MX Client Driver architecture, 14 P PI function, 36 POWER function, 36 PUBLIC_ACCESS_SCHEMA schema, 18 Q QUARTER function, 37 R RADIANS function, 36 RAND function, 36 REAL data type, 38 REPEAT function, 37 REPLACE function, 37 restrictions, 18 RIGHT function, 37 ROUND function, 36 RTRIM function, 37 S SECOND function, 38 SIGN function, 36 SIN function, 36 SINH function, 36 SMALLINT data type, 38 SOUND
W WEEK function, 38 64 Index