================================= RELEASE NOTES FOR INFORMIX-CLI 2.80.0008.TC1 PRODUCT RELEASE DATE: 18 Dec 1998 ================================= TABLE OF CONTENTS I. Database Servers Tested II. System Requirements III. Driver Managers IV. Files Installed V. Major Features in INFORMIX-CLI 2.8 VI. Changes to infxcli.h file VII. Troubleshooting INFORMIX-CLI for Windows VIII. Known Product Deficiencies IX. 8.3 SELECT with UPDATE not yet supported by CLI driver X. Client Functions Not Support ***UD ONLY *** XI. CLI 2.8 and CLI 2.5 Differences XII. MTS *** WINDOWS-ONLY *** XIII. Fixed Customer Reported Problems XIV. Set and Get default UDT (User Defined Type) fetch type. XV. Arrays of Parameter support and Insert Cursor support =============================== I. DATABASE SERVERS TESTED INFORMIX-CLI 2.8 has been tested for the following Informix database servers: - Informix Dynamic Server, Version 7.3x - Informix Dynamic Server, Workgroup Edition, Version 7.3x - Informix Dynamic Server with Advanced Decision Support and Extended Parallel Options, Version 8.2x - Informix Dynamic Server with Universal Data Option, Version 9.14. =============================== II. SYSTEM REQUIREMENTS Windows Requirements -------------------- The system requirements for running INFORMIX-CLI in a Windows NT or Windows 95 environment are the following: * Windows NT version 3.51 or later, Windows 95, or Windows 98. * 16 megabytes of available RAM, more is preferable. * 8.5 megabytes of hard-disk space available before installation. * Any TCP/IP protocol that is Windows Sockets 1.1-compliant. * Microsoft Visual C++ compiler version 2.0 or later. INFORMIX-CLI does not support any other C compiler. =============================== III. DRIVER MANAGERS Windows Driver Managers ----------------------- Version Shipped --------------- INFORMIX-CLI for Windows ships with the Microsoft Driver Manager Version 3.5. Problems when Using Version 3.0 ------------------------------- If other programs that you are using require you to use Microsoft Driver Manager Version 3.0, a buffer-size problem might occur with some of your INFORMIX-CLI applications. The problem can occur when Microsoft Driver Manager Version 3.0 doubles the total number of bytes available to return. The following steps provide an example of this problem: 1. A column name that you are retrieving consists of 15 characters (but you do not know this). 2. You call SQLDescribeCol() with cbColNameMax set to 10. 3. SQLDescribeCol() returns a value of 30 for pcbColName. SQLDescribeCol() should have returned a value of 15 for pcbColName. However, Microsoft Driver Manager Version 3.0 doubled pcbColName because it doubles the total number of bytes available to return when the output buffer is not large enough to hold all the data. 4. You reallocate the szColName buffer for 30 bytes. 5. You call SQLDescribeCol() with cbColNameMax set to 30. 6. SQLDescribeCol() returns a value of 15 for pcbColName. Microsoft Driver Manager 3.0 does not double the total number of bytes available to return when the output buffer is large enough to hold all the data. 7. If you do not compare the first pcbColName value to the second pcbColName value, then you do not have a problem. However, if you compare the two values and expect them to be the same, you will conclude that an error has occurred when, in fact, an error has not occurred. For information about how to install the correct version of Microsoft Driver Manager, see the README file for the Windows version of INFORMIX-CLI. UNIX Driver Manager ------------------- INFORMIX-CLI for UNIX ships with the INTERSOLV Driver Manager Version 3.0. =============================== IV. FILES INSTALLED Files on Windows ---------------- In the Windows environment, the installation procedure installs files into the following directories: Directory Description --------- ----------- INFORMIXDIR\bin finderr.exe and DLLs INFORMIXDIR\demo\clidemo Samples INFOMRIXDIR\gls\cm3 GLS charmap files and registry files INFORMIXDIR\gls\cv9 GLS code set conversion files INFORMIXDIR\gls\lc11 GLS locale files INFORMIXDIR\incl\cli Header files: infxcli.h, sql.h, sqlext.h INFORMIXDIR\lib Libraries INFORMIXDIR\msg clixmsg.pam INFORMIXDIR\msg\en_us\04e4 Message files and errmess.hlp INFORMIXDIR\release\en_us\04e4 Document notes and release notes WINDOWSSYSTEMDIR Common DLLs and files for the Microsoft Driver Manager Files on UNIX ------------- On UNIX, in addition to common ClientSDK distribution, the installation procedure installs files into the following directories: Directory Description --------- ----------- INFORMIXDIR/demo/cli Demos INFORMIXDIR/incl/cli Header files: infxcli.h, infxsql.h INFORMIXDIR/lib/cli Libraries for INFORMIX-CLI and for the INTERSOLV Driver Manager INFORMIXDIR/lib/esql Libraries for INFORMIX-CLI and INFORMIX-ESQL/C INFORMIXDIR/msg clixmsg.pam INFORMIXDIR/msg/en_us/0333 Message files for INFORMIX-CLI INFORMIXDIR/release/en_us/0333 Document notes, release notes, and machine notes Library Names on Windows ------------------------ On Windows, the installation procedure installs the following libraries into INFORMIXDIR\lib: iclit09a.lib iregt07b.lib Library Names on UNIX --------------------- On UNIX, the installation procedure installs the following libraries into INFORMIXDIR/lib/cli. In each Data Source specification section in the .odbc.ini file, set the Driver value to one of these library filenames: Filename Description -------- ----------- libifcli.a or libcli.a Static version for single threaded library (non-threaded) libifcli.so or iclis09a.so Shared version for single (non-threaded) library libthcli.a Static version for multi-threaded library libthcli.so or iclit09a.so Shared version for multi-threaded library =============================== V. MAJOR FEATURES IN INFORMIX-CLI 2.8 Multithreading Support ---------------------- For a multithreaded application, INFORMIX-CLI latches an external handle (such as ENV, DBC, and STMT) while a thread is using the handle. If a concurrent thread tries to access an external handle that is already in use, the concurrent thread waits until the owning thread releases the handle. INFORMIX-CLI latches an external handle at the lowest possible level in the handle tree to achieve the greatest concurrency. Multiple Connection Support in Threads -------------------------------------- INFORMIX-CLI supports multiple database connections in the same or different threads. Connections are always explicit and are simultaneously active. Each connection operates within its own scope and does not interact with any other connection. Any thread can access handles that any other thread created. Any thread can support multiple connections simultaneously. SQLCancel() Support ------------------- INFORMIX-CLI supports SQLCancel() for multithreaded applications. For example, if you are executing a statement with hstmt1 in thread one, you can call SQLCancel() for hstmt1 from thread two to cancel the statement execution. Server-Only Connection ---------------------- INFORMIX-CLI supports a server-only connection option which lets you create a new database or drop an existing database. Named Pipes ----------- INFORMIX-CLI supports named pipes. Exclusive Use of a Database --------------------------- INFORMIX-CLI supports a connection option that lets you use a database exclusively. By default, INFORMIX-CLI allows shared use of a database. Row ID of the Last Inserted Row as a Statement Option ----------------------------------------------------- The row ID of the last inserted row is visible and retrievable as a statement option. DBCENTURY Environment Variable Support -------------------------------------- INFORMIX-CLI supports the DBCENTURY environment variable, which controls the setting of year values. DBCENTURY affects a CLI program only when a user issues a statement that contains a date or datetime string like the following one: insert into datetable ( datecol ) values ("01/01/01"); Depending on the value to which DBCENTURY is set on the client, the database server stores the date specified in this statement as either 01-01-1901 or 01-01-2001. On a Windows NT platform, you can set DBCENTURY directly into the registry under the following key: \HKEY_CURRENT_USER\Software\Informix\Environment\DBCENTURY Or a Windows NT, Windows 95, or Windows 98, you can set the value of the DBCENTURY environment variable through Setnet32, which Informix ships as part of the product. On a UNIX platform, you can simply set the DBCENTURY environment variable. For information on how to set DBCENTURY, see the Informix Guide to SQL: Reference. =============================== VI. CHANGES TO infxcli.h The following defines were added to infxcli.h: * New SQL data types * New InfoType values for SQLGetInfo() * Access mode flags to use when creating or opening a smart large object * Create-time flags to use in the smart large object specification structure * Values for the whence argument that identifies the position from which to start a seek =============================== VII. TROUBLESHOOTING INFORMIX-CLI for Windows Buy Microsoft ODBC SDK version 2.5 (or 3.0) or Dr. Deebee ODBC Tool kits to help you troubleshoot your application. =============================== VIII. KNOWN PRODUCT DEFICIENCIES The following defects are known to exist in the current release of INFORMIX-CLI 2.8. The defects are listed by PTS (Problem Tracking System) number followed by a brief description. Technical support will be provided with patches and maintenance releases to fix these defects. PTS # Description ----- ----------- 82205 When it receives a PROCESS_DETACH message, CLI should clean up all active threads, but it does not because CLI may not get a THREAD_DETACH message for each active thread. 84697 CLI 2.8 crashes an Access client when it tries to fetch data from a row data type, whereas CLI 2.7 fails with error -11064. CLI 2.8 either cannot determine the return types of a query or the return types are inconsistent. 88735 When using the GLS QA_QA locale, a client can't fetch from table names with embedded spaces. 92681 PowerBuilder 4x applications may not run properly outside the PowerBuilder environment with CLI 2.80. PowerBuilder 4x applications may not run properly outside the PB because of different msvcrt40.dll used from the path. The msvcrt40.dll that comes along with MSVC5.x is not redistributable. Since Informix-CLI is compiled with MSVC 5.x and uses msvcrt.dll, the PB 4 applications running outside the PowerBuilder may pickup MSVC 4.x version of msvcrt40.dll which is not the same. If MSVC 5.0 is installed, the PowerBuilder application will run fine inside as well as outside the PowerBuilder. 94633 Columns created as decimal(8) and decimal(16) gets described as real and double respectively instead of decimal. This happens when client and server are running on dissimilar hardware platforms - this can cause different floating point formats to be used (IEEI and IEEM) on two platforms. In such case float and smallfloat data will be transferred in decimal format. Decimal(8) columns gets descscibed in the same way as a smallfloat column does. and Decimal(16) columns gets described the same way as float column does. If possible create columns with explicit scale - like decimal(8,5) or decimal(8,2). 95281 SQLCancel() does not work correctly with ODS 7.3 for Windows NT 4.0. A protocol error occurs. To work around this problem, install NT Service Pack 3 and then install the Tear Patch 2 from Microsoft. Tear Patch 2 is available at: ftp://ftp.microsoft.com/bussys/winnt/winnt-public /fixes/usa/nt40/hotfixes-postSP3/teardrop2-fix 98950 The SQL_LEN_DATA_AT_EXEC(length) macro wraps around to a positive value if the length specified is the maximum size of the data type. This problem occurs due to overflow. 99509 CLOBs do not get null-terminated when they are retrieved. Therefore, any attempt to display the CLOB causes junk characters to be displayed at the end. To work around this problem, determine the size of the CLOB and add the null-termination character. 100570 CLI 2.8 does not allow the user to do an insertion of a literal string into a text column with SQLEXECDIRECT. =============================== ----------- IDS-AD/XP ONLY ------------------- IX. 8.3 SELECT with UPDATE not yet supported by CLI driver The 8.3 syntax SELECT with UPDATE clause is not supported by the CLI driver yet. Workaround: Set the SQL_ATTR_NOSCAN statement attribute to SQL_NOSCAN_OFF prior to executing these statements. Note that due to this there cannot be any native escape sequences in the statement. ----------- IDS-AD/XP ONLY ------------------- =============================== ----------- UD-ONLY ------------------- X. Client Functions Not Support INFORMIX-CLI does not support the following client functions: * ifx_lo_copy_to_file() * ifx_lo_copy_to_lo() * ifx_lo_filename() * ifx_lo_spec_free() * ifx_lo_stat_free() ----------- UD-ONLY ------------------- =============================== XI. CLI 2.8 and CLI 2.5 Differences The following features are supported by INFORMIX-CLI 2.5 but are not supported by INFORMIX-CLI 2.7 and later. Support for ODBC SQLSetStmtOption options: SQLRESERVED_WORDS SQLPSUEDO_COLUMNS SQLFROM_RESERVED_WORDS SQLWHERE_CLAUSE_TERMINATORS SQLCOLUMN_FIRST_CHARS SQLTABLE_MIDDLE_CHARS SQLFAST_SPECIAL_MIDDLE_COLUMNS SQLACCESS_CONFLICTS SQLLOCKING_DURATION SQLRECORD_OPTIONS SQLQUALIFIER_SYNTAX SQLLOCKING_SYNTAX Support for the INSERT statement for text data: With INFORMIX-CLI 2.5, TEXT data can be inserted as a string literal. INFORMIX-CLI 2.7 and 2.8 do not support this syntax. INTERVAL data type In INFORMIX-CLI 2.5, an INTERVAL data type is mapped to SQL_CHAR. INFORMIX-CLI 2.7 and later does not support the INTERVAL data type. =============================== ----------- WINDOWS-ONLY ------------ WINDOWS-ONLY ------------------- XII. MTS System Requirements ------------------- In addition to the Windows system requirements described earlier in these Release Notes, the MTS feature has the following requirements: * MTS 2.0 on Windows NT 4.0, Windows 95, or Windows 98. * An Informix server that supports the TP/XA protocol. * Windows NT version 4.0 with Service Pack 3 or Windows 95 or Windows 98. * Microsoft Visual C++ compiler version 4.2 or later. The MTS feature does not support any other C compiler. Major Features -------------- The INFORMIX-CLI implementation of MTS provides the following major features: - Supports distributed transactions in a Distributed Database Environment. - Supports connection pooling. Product Deficiencies -------------------- The INFORMIX-CLI implementation of MTS has the following deficiencies: - An inherited transaction may have a problem in joining other transactions. This problem can be represented as follows. The two transactions (Inherited and Parent) will get two different XIDs from the DTC; they will not share the same lock space. They will be treated as two different transactions by the server. This may create a dead lock if they want the same resource. This will not happen in an XA Transaction because both the transactions get the same XID and share the lock space. WorkAround: Try to isolate the resources as much as possible (by using lock mode (row), indexing etc.). - The last thread of a multi-threaded application may hang if you are running MTS using the library package option. WorkAround: If you are running a multi- threaded application, select the Server package option. - User cannot spawn a thread within MTS component. ----------- WINDOWS-ONLY ------------ WINDOWS-ONLY ------------------- =============================== XIII. FIXED CUSTOMER-REPORTED PROBLEMS The following defects were reported by customers and fixed. The defects are listed by PTS (Problem Tracking System) number followed by a brief description. PTS # DESCRIPTION ----- ----------- 73132 INFORMIX-CLI 2.50.TD2: The ODBC driver IVINF709.DLL is not recognizing the unique index in a table and, therefore, no updates are allowed from VB or MS-Access. 97613 USING ODBC DRIVERS, A VARCHAR FIELD WILL HAVE TRAILING SPACES TRUNCATED. This is still the default beahavior. However for the users who wants the trailing spaces in a VARCHAR field to be preserved, a connection option SQL_INFX_ATTR_LEAVE_TRAILING_SPACES is added. User can set this option to SQL_TRUE or SQL_FALSE. To set and get this option value use ODBC functions SQLSetConnectOption and SQLGetConnectOption. The default value for this option is SQL_FALSE. This option is defined in infxcli.h file. 98934 SQLPutData fails to convert data from SQL_C_CHAR to SQL types other than SQL_CHAR and SQL_BINARY, i.e. conversion of SQL_C_CHAR data provided using SQLPutData call to SQL type, say SQL_DECIMAL fails. The application sending data (rgbValue) for a parameter to the driver at statement execution time can send any character or binary data values in parts to a column with any SQL data type. The length of character data should be less than or equal to 64 for data types other than BYTE, CHAR, VARCHAR, TEXT, LVARCHAR, SQLUDTFIXED, SQLUDTCHAR. Driver will return warning for "Data Truncation" if the length is greater than 64. 98947 CLI 2.80 does not support SQL_CURSOR_COMMIT_BEHAVIOUR SQL_CB_PRESERVE CLI 2.80 now supports cursor commit behavior: SQL_CB_PRESERVE. On Win32 platforms: Application can set cursor behavior using CLI 2.80 DSN config dialog box. Default cursor behavior is SQL_CB_CLOSE. On UNIX platforms: User needs to add flag 'CursorBehavior' to the appropriate DSN entry in the .odbc.ini file. When the flag is set to 0, i.e. entry CursorBehavior=0 is added to the appropriate DSN cursor behavior will be SQL_CB_CLOSE. when CursorBehavior=1, cursor behavior will be SQL_CB_PRESERVE. When CursorBehavior flag is not set, or when it is set to any value other than 0 or 1 - default cursor behavior of Close (SQL_CB_CLOSE) will be asumed. 101112 SYNTAX ERROR ON NESTED SELECT STATMENT WITH INFORMIX CLI DRIVER. Example: "select fname, (select customer_num from customer where customer_num=101) from customer where customer_num=101", used to get -201 syntax error 101327 SQLPREPARE() GIVES SYNTAX ERRORS WHEN THE SQL CREATING A STORED PROCEDURE INCLUDES A BEGIN WORK STATEMENT For instance if you try to prepare the following it used to give a -11060 error (Syntax error) CREATE PROCEDURE tst() BEGIN WORK; END PROCEDURE; 101977 CLI 2.8 does not handle DSN LESS connection. If you did not create a DSN and tried to connect through the SQLDriverConnect with the following syntax, you got an error -11060 insufficient connection information. The syntax of the connection string is: connection-string ::= empty-string[;] | attribute[;] | attribute; connection-string empty-string ::= attribute ::= attribute-keyword=attribute-value | DRIVER=[{]attribute-value[}] attribute-keyword ::= DSN | UID | PWD | driver-defined-attribute-keyword attribute-value ::= character-string driver-defined-attribute-keyword ::= identifier For Informix CLI Driver User has to use two additional key words CLIENT_LOCALE and DB_LOCALE. User has to set it to default locale even if he/she does not have a LOCALE set. The default is en_US.CP1252. The call to SQLDriverConnect looks like rc = SQLDriverConnect(hdbc, NULL,"DRIVER=INFORMIX 2.80 32 BIT; DATABASE= ovs;HOST=clipper;SERVICE=turbo;SERVER=ol_clipper;PROTOCOL=onsoctcp ;UID=odbc;PWD=odbc;CLIENT_LOCALE=en_US.CP1252;DB_LOCALE=en_US.CP1252;", SQL_NTS, szerrormessage, 256, pcberrormessage, SQL_DRIVER_NOPROMPT); 102448 LOCALE CONVERSION CHANGES WHEN SPECIFY TRANSLATION LIBRARY WITH IN DATA SOURCE. The default conversion of locales did not use any translation library and used to work with default English locales only. The default translation library is now set to "igo4n304.dll", if no translation library is specified in DSN. 103715 CLI 2.80 DOES NOT WORK WITH SE VERSION 7.2X COMES BACK WITH 554 SYNTAX DISALLOWED. The driver fixes the generation of catalog queries with tablename qualifier like 'database:owner.tablename' which is not allowed per SE syntax. 104520 WHEN YOU CREATE A DSN FOR A PARTICULAR SERVER USING ODBCAD32, THE OPTIONS SETTING FOR THE SERVER SET IN SETNET32 IS LOST. This is a WIN32 platform specific bug. Currently CLI DSN create dialog box does not allow user to set the options field in the sqlhosts file (stored in the windows registry). Workaround is as follows: To set the options field (say when you are using CSM encry- ption), you will have to use setnet32 utility. When you create a CLI DSN - it creates an entry for the given Informix server in the Windows registry. Use setnet32 once you have created an entry for the given CLI DSN. Edit the sqlhosts entry for the given server and set the options field. If you edit the CLI DSN after the options field is set using setnet32, you will need to rerun setnet32 to set the options field. =============================== ---------- IDS UDO ONLY -------------- XIV. Set and Get default UDT (User Defined Type) fetch type. When UDTs are fetched by the Informix CLI driver, the CLI driver needs to inform the server about what format the data should be sent back to the client. The formats allowed are Character and Binary. Earlier behavior of the CLI driver was: . If user bind a UDT column with C type SQL_C_CHAR, CLI will request the server to send back the UDT data in character format. . If user binds the same column with C type SQL_C_BINARY, CLI will request server to send back UDT data in Binary format. . If user does not bind the UDT column - default was taken as SQL_C_BINARY. User is now allowed to change the default behavior. User can set a connection option SQL_INFX_ATTR_DEFAULT_UDT_FETCH_TYPE to either SQL_C_CHAR or SQL_C_BINARY. Default fetch type is SQL_C_BINARY, this will maintain backward compatibility. This option is defined in infxcli.h file. To set and get this option value use ODBC functions SQLSetConnectOption and SQLGetConnectOption. Also user can manully add a value for the given DSN in the Windows registry as: SQL_INFX_ATTR_DEFAULT_UDT_FETCH_TYPE=SQL_C_CHAR or this value can be set to SQL_C_BINARY. Above is true for WIN32 platforms only, for UNIX platform user will need to update .odbc.ini. ---------- IDS UDO ONLY -------------- =============================== XV. Arrays of Parameter support and Insert Cursor support These two features are added to allow user to do fast bulk inserts. Arrays of Parameter allows user to specify an array of parameter and execute a statement. The statement will be executed for each row in the given array of parameters. In its current implementation, the statement specified by the user can only be an Insert statement. To specify an array of parameter user will need to use SQLBindParam calls along with call to function SQLParamOptions. SQLParamOptions allows user to set the count of the rows in the array of parameters. An Insert statement executed after the above mentioned calls will get executed for each row of the array. Above support speeds up the data insert process considerably and simplifies the ODBC application for the user. To further speed up the data insert process - insert cursor support is added. When user sets statement option SQL_ENABLE_INSERT_CURSOR, along with the array of parameters specified, CLI does not make a round trip to the server for each row to be inserted. CLI opens an insert cursor, buffers up the insert requests on the client end and when the buffer gets full (size of the buffer is currently set to 4K and user cannot change it), CLI sends across this buffer to the server. Depending on the size of the data each insert reuqest carries with it, number of network round trips between client and server can reduce manifold with the insert cursors. Option SQL_ENABLE_INSERT_CURSOR is defined in infxcli.h file. Support for insert cursors is completely transparent to the user. User need not make any additional calls to open and close an insert cursor. Since insert cursor buffers up the insert requests on the client side with a limitaion that each set of data must occupy same space - data types whose size can be variable are not supported by the insert cursors. These types are TEXT, BYTE, UDTs, CLOB, BLOB and LVARCHAR. Attached is a sample program that demonstrates the use of Arrays of Parameter and Insert Cursors. #include #include #include #include "infxcli.h" #include "odbcqa.h" void main(int argc, char *argv[]) { HENV henv; HDBC hdbc; HSTMT hstmt; UCHAR create[MAX_NAME_LEN + 1]; UCHAR insert[MAX_NAME_LEN + 1]; DWORD iRow; int i; short c1[5]; long c2[5]; char c3[5][10]; char c4[5][11]; char c5[5][10]; float c6[5]; double c7[5]; DATE_STRUCT c8[5]; TIMESTAMP_STRUCT c9[5]; DWORD c1ind[5]; DWORD c2ind[5]; DWORD c3ind[5]; DWORD c4ind[5]; DWORD c5ind[5]; DWORD c6ind[5]; DWORD c7ind[5]; DWORD c8ind[5]; DWORD c9ind[5]; if ( argc != 4 ) { printf("Usage: insert_cursor datasourcename userid passwd\n"); assert(0); } rc = SQLAllocEnv(&henv); assert(rc!=SQL_ERROR); rc = SQLAllocConnect(henv, &hdbc); ASSERT(henv, NULL, NULL); rc = SQLConnect(hdbc, argv[1], SQL_NTS, argv[2], SQL_NTS, argv[3], SQL_NTS); ASSERT(NULL, hdbc, NULL); rc = SQLAllocStmt(hdbc, &hstmt); ASSERT(NULL, hdbc, NULL); rc = SQLExecDirect(hstmt, "DROP TABLE test", SQL_NTS); strcpy(create, "CREATE TABLE test (a smallint, b int, c decimal( 6,2 ), d char(10), e varchar(10), f smallfloat, g float, h date, i datetime year to fraction(5) )"); rc = SQLExecDirect(hstmt, create, SQL_NTS); ASSERT(NULL, NULL, hstmt); /* ** remove following call if you just want to use array of parameter, without ** insert cursor feature. */ /* Set the statement option to enable insert cursors */ rc = SQLSetStmtOption(hstmt,SQL_ENABLE_INSERT_CURSOR,1); ASSERT(NULL, NULL, hstmt); rc = SQLParamOptions(hstmt, 5, &iRow); ASSERT(NULL, NULL, hstmt); /* Bind param 1 */ rc = SQLBindParameter( hstmt, 1, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_SMALLINT, (SWORD)NULL, 0, c1, 0, c1ind ); ASSERT(NULL, NULL, hstmt); /* Bind param 2 */ rc = SQLBindParameter( hstmt, 2, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, (SWORD)NULL, 0, c2, 0, c2ind ); ASSERT(NULL, NULL, hstmt); /* Bind param 3 */ rc = SQLBindParameter( hstmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_DECIMAL, 6, 2, c3, 10, c3ind ); ASSERT(NULL, NULL, hstmt); /* Bind param 4 */ rc = SQLBindParameter( hstmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 8, 0, c4, 11, c4ind ); ASSERT(NULL, NULL, hstmt); /* Bind param 5 */ rc = SQLBindParameter( hstmt, 5, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 10, 0, c5, 10, c5ind ); ASSERT(NULL, NULL, hstmt); /* Bind param 6 */ rc = SQLBindParameter( hstmt, 6, SQL_PARAM_INPUT, SQL_C_FLOAT, SQL_REAL, (SWORD)NULL, 0, c6, 0, c6ind ); ASSERT(NULL, NULL, hstmt); /* Bind param 7 */ rc = SQLBindParameter( hstmt, 7, SQL_PARAM_INPUT, SQL_C_DOUBLE, SQL_DOUBLE, (SWORD)NULL, 0, c7, 0, c7ind ); ASSERT(NULL, NULL, hstmt); /* Bind param 8 */ rc = SQLBindParameter( hstmt, 8, SQL_PARAM_INPUT, SQL_C_DATE, SQL_DATE, (SWORD)NULL, 0, c8, 0, c8ind ); ASSERT(NULL, NULL, hstmt); /* Bind param 9 */ rc = SQLBindParameter( hstmt, 9, SQL_PARAM_INPUT, SQL_C_TIMESTAMP, SQL_TIMESTAMP, 24, 4, c9, 0, c9ind ); ASSERT(NULL, NULL, hstmt); /* Fill up the data array */ for( i = 0; i < 5; i++ ) { c1[i] = i+3; c2[i] = 110; strcpy( c3[i], "1230.45" ); strcpy( c4[i], "char" ); strcpy( c5[i], "varchar" ); c6[i] = ( float )1.1e+03; c7[i] = ( double )1.1e+05; c8[i].year = 2000; c8[i].month = 2; c8[i].day = 29; c9[i].year = 1996; c9[i].month = 7; c9[i].day = 4; c9[i].hour = 12; c9[i].minute = 30; c9[i].second = 30; c9[i].fraction = 2000; c1ind[i] = 0; c2ind[i] = 0; c3ind[i] = SQL_NTS; c4ind[i] = 8; c5ind[i] = SQL_NTS; c6ind[i] = 0; c7ind[i] = 0; c8ind[i] = 0; c9ind[i] = 0; } /* make all columns for third row NULL */ c1ind[2] = SQL_NULL_DATA; c2ind[2] = SQL_NULL_DATA; c3ind[2] = SQL_NULL_DATA; c4ind[2] = SQL_NULL_DATA; c5ind[2] = SQL_NULL_DATA; c6ind[2] = SQL_NULL_DATA; c7ind[2] = SQL_NULL_DATA; c8ind[2] = SQL_NULL_DATA; c9ind[2] = SQL_NULL_DATA; strcpy(insert, "INSERT INTO test VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"); rc = SQLExecDirect(hstmt, insert, SQL_NTS); ASSERT(NULL, NULL, hstmt); rc = SQLFreeStmt(hstmt, SQL_DROP); ASSERT(NULL, NULL, hstmt); rc = SQLDisconnect(hdbc); ASSERT(NULL, hdbc, NULL); rc = SQLFreeConnect(hdbc); ASSERT(NULL, hdbc, NULL); rc = SQLFreeEnv(henv); ASSERT(henv, NULL, NULL); /* ** Use tool like Microsoft ODBC Test or another ODBC program to ** verify that data has been properly inserted into the table 'test' */ } ===============================