10 October 2006
The DB2 port uses the Call Level Interface (CLI) provided by DB2. This CLI is based on the X/Open CLI and is very similar to the ODBC API.
The following connects to the SAMPLE database running on the local machine with a connection name of MYCON. It is assumed that the user has previously logged on, or will be prompted for a userid and password.
rc = sqlconnect("MYCON",,,"SAMPLE")
rc = sqlconnect(,'FRED','WILMA',"SAMPLE")
DB2 uses the standard placemarker; ?. See 7. Standard placemarkers and bind variables for further details.
The datatypes supported by DB2 can be determined by a call to SQLGETINFO with the DATATYPES option.