`
`SQLGetInfo
`
`Related Functions
`
`For information about
`
`See
`
`Returning the setting of a connection option
`Determining if a driver supports a function
`Returning the setting of a statement option
`Returning information about a data source's
`data types
`
`SQLGetConnectOption (extension)
`SQLGetFunctions (extension)
`SQLGetStmtOption (extension)
`SQLGetTypelnfo (extension)
`
`Page 301 of 434
`
`RA v. AMS
`Ex. 1020
`
`(cid:9)
`
`
`SQLGetStmtOption
`
`SQLGetStmtOption (cid:9)
`
`387
`
`ODBC 1.0
`
`Extension Level 1 (cid:9)
`
`SQLGetStmtOption returns the current setting of a statement option.
`
`Syntax (cid:9)
`
`RETCODE SQLGetStmtOption(hstmt, fOption, pvParam)
`
`The SQLGetStmtOption function accepts the following arguments:
`
`Returns (cid:9)
`
`Diagnostics (cid:9)
`
`Type (cid:9)
`
`HSTMT
`UWORD
`PTR
`
`Argument (cid:9)
`
`Use (cid:9)
`
`Description
`
`hstmt
`fOption
`pvParam
`
`Input
`Input
`Output.
`
`Statement handle.
`Option to retrieve.
`Value associated with fOption.
`Depending on the value of
`fOption, a 32-bit integer value
`or a pointer to a null-terminated
`character string will be returned
`in pvParam.
`
`SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or
`SQL_INVALID_HANDLE.
`
`When SQLGetStmtOption returns SQL_ERROR or
`SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained
`by calling SQLError. The following table lists the SQLSTATE values commonly
`returned by SQLGetStmtOption and explains each one in the context of this
`function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned
`by the Driver Manager. The return code associated with each SQLSTATE value is
`SQL_ERROR, unless noted otherwise.
`
`SQLSTATE
`
`Error (cid:9)
`
`Description
`
`01000 (cid:9)
`
`24000 (cid:9)
`
`IM001 (cid:9)
`
`General warning (cid:9)
`
`Invalid cursor state (cid:9)
`
`Driver-specific informational message.
`(Function returns
`SQL_SUCCESS_WITH_INFO.)
`The argument fOption was
`SQL_ROW_NUMBER or
`SQL_GET_BOOKMARK and the cursor
`was not open, or the cursor was positioned
`before the start of the result set or after the
`end of the result set.
`(DM) The driver corresponding to the hstmt
`Driver does not (cid:9)
`support this function does not support the function.
`
`Page 302 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`388 (cid:9)
`
`SQLGetStmtOption
`
`SQLSTATE
`
`Error
`
`Description
`
`S1000
`
`General error
`
`51001
`
`51010
`
`S1011
`
`S1092
`
`S1109
`
`Memory allocation
`failure
`
`Function sequence
`error
`
`Operation invalid at
`this time
`
`Option type out of
`range
`
`Invalid cursor
`position
`
`S 1C00
`
`Driver not capable
`
`An error occurred for which there was no
`specific SQLSTATE and for which no
`implementation-specific SQLSTATE was
`defined. The error message returned by
`SQLError in the argument szErrorMsg
`describes the error and its cause.
`The driver was unable to allocate memory
`required to support execution or completion
`of the function.
`(DM) An asynchronously executing
`function was called for the hstmt and was
`still executing when this function was
`called.
`(DM) SQLExecute, SQLExecDirect, or
`SQLSetPos was called for the hstmt and
`returned SQL_NEED_DATA. This
`function was called before data was sent for
`all data-at-execution parameters or
`columns.
`The fOption argument was
`SQL_GET_BOOKMARK and the value of
`the SQL_USE_BOOKMARKS statement
`option was SQL_UB_OFF.
`(DM) The value specified for the argument
`fOption was in the block of numbers
`reserved for ODBC connection and
`statement options, but was not valid for the
`version of ODBC supported by the driver.
`The fOption argument was
`SQL_GET_BOOKMARK or
`SQL_ROW_NUMBER and the value in the
`rgfRowStatus array in SQLExtendedFetch
`for the current row was
`SQL_ROW_DELETED or
`SQL_ROW_ERROR.
`The value specified for the argument
`fOption was a valid ODBC statement
`option for the version of ODBC supported
`by the driver, but was not supported by the
`driver.
`The value specified for the argument
`fOption was in the block of numbers
`reserved for driver-specific connection and
`statement options, but was not supported by
`the driver.
`
`Page 303 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`SQLGetStmtOption (cid:9)
`
`389
`
`Comments
`
`The following table lists statement options for which corresponding values can be
`returned, but not set. The table also lists the version of ODBC in which they were
`introduced. For a list of options that can be set and retrieved, see
`SQLSetStmtOption. If fOption specifies an option that returns a string, pvParam
`must be a pointer to storage for the string. The maximum length of the string will
`be SQL_MAX_OPTION_STRING_LENGTH bytes (excluding the null
`termination byte).
`
`fOption (cid:9)
`SQL_GET_BOOKMARK
`(ODBC 2.0)
`
`SQL_ROW_NUMBER
`(ODBC 2.0)
`
`pvParam contents
`
`A 32-bit integer value that is the bookmark for the current row.
`Before using this option, an application must set the
`SQL_USE_BOOKMARKS statement option to SQL_UB_ON,
`create a result set, and call SQLExtendedFetch.
`To return to the rowset starting with the row marked by this
`bookmark, an application calls SQLExtendedFetch with the
`SQL_FETCH_BOOKMARK fetch type and irow set to this value.
`Bookmarks are also returned as column 0 of the result set.
`A 32-bit integer value that specifies the number of the current row
`in the entire result set. If the number of the current row cannot be
`determined or there is no current row, the driver returns 0.
`
`Related Functions
`
`For information about
`See
`Returning the setting of a connection option SQLGetConnectOption (extension)
`SQLSetConnectOption (extension)
`Setting a connection option (cid:9)
`SQLSetStmtOption (extension)
`Setting a statement option (cid:9)
`
`Page 304 of 434
`
`RA v. AMS
`Ex. 1020
`
`(cid:9)
`
`
`SQLGetTypelnfo
`390 (cid:9)
`SQLGetTypelnfo
`
`ODBC 1.0
`
`Extension Level 1 (cid:9)
`
`SQLGetTypelnfo returns information about data types supported by the data
`source. The driver returns the information in the form of an SQL result set.
`
`Important Applications must use the type names returned in the TYPE_NAME
`column in ALTER TABLE and CREATE TABLE statements; they must not
`use the sample type names listed in Appendix C, "SQL Grammar."
`SQLGetTypelnfo may return more than one row with the same value in the
`DATA_TYPE column.
`
`Syntax (cid:9)
`
`RETCODE SQLGetTypelnfo(hstmt, fiSqlType)
`
`The SQLGetTypelnfo function accepts the following arguments:
`
`Page 305 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`Type
`
`HSTMT (cid:9)
`SWORD (cid:9)
`
`Argument (cid:9)
`
`hstrnt (cid:9)
`fSqlType (cid:9)
`
`Use (cid:9)
`Input (cid:9)
`Input (cid:9)
`
`SQLGetTypelnfo (cid:9)
`
`391
`
`Description
`
`Statement handle for the result set.
`The SQL data type. This must be one of the
`following values:
`SQL_BIGINT
`SQL_BINARY
`SQL_BIT
`SQL_CHAR
`SQL_DATE
`SQL_DECIMAL
`SQL_DOUBLE
`SQL_FLOAT
`SQL_INTEGER
`SQL_LONGVARBINARY
`SQL_LONGVARCHAR
`SQL_NUMERIC
`SQL_REAL
`SQL_SMALLINT
`SQL_TIME
`SQL_TIMESTAMP
`SQL_TINYINT
`SQL_VARBINARY
`SQL_VARCHAR
`or a driver-specific SQL data type.
`SQL_ALL_TYPES specifies that
`information about all data types should be
`returned.
`For information about ODBC SQL data
`types, see "SQL Data Types" in Appendix
`D, "Data Types." For information about
`driver-specific SQL data types, see the
`driver's documentation.
`
`Returns (cid:9)
`
`Diagnostics (cid:9)
`
`SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING,
`SQL_ERROR, or SQL_INVALID_HANDLE.
`
`When SQLGetTypelnfo returns SQL_ERROR or
`SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained
`by calling SQLError. The following table lists the SQLSTATE values commonly
`returned by SQLGetTypelnfo and explains each one in the context of this
`function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned
`by the Driver Manager. The return code associated with each SQLSTATE value is
`SQL_ERROR, unless noted otherwise.
`
`Page 306 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`392 (cid:9)
`
`SQLGetTypelnfo
`
`SQLSTATE
`
`Error
`
`Description
`
`01000
`
`General warning
`
`08S01
`
`Communication
`link failure
`
`24000
`
`Invalid cursor state
`
`IM001
`
`51000
`
`51001
`
`51004
`
`Driver does not
`support this
`function
`General error
`
`Memory allocation
`failure
`
`SQL data type out
`of range
`
`S1008
`
`Operation canceled
`
`Driver specific informational message.
`(Function returns
`SQL_SUCCESS_WITH_INFO.)
`The communication link between the driver
`and the data source to which the driver was
`connected failed before the function
`completed processing.
`(DM) A cursor was open on the hstmt and
`SQLFetch or SQLExtendedFetch had not
`been called.
`A result set was open on the hstmt but
`SQLFetch or SQLExtendedFetch had not
`been called.
`(DM) The driver corresponding to the hstmt
`does not support the function.
`
`An error occurred for which there was no
`specific SQLSTATE and for which no
`implementation-specific SQLSTATE was
`defined. The error message returned by
`SQLError in the argument szErrorMsg
`describes the error and its cause.
`The driver was unable to allocate memory
`required to support execution or completion
`of the function.
`(DM) The value specified for the argument
`fSqlType was in the block of numbers
`reserved for ODBC SQL data type
`indicators but was not a valid ODBC SQL
`data type indicator.
`Asynchronous processing was enabled for
`the hstmt, then the function was called and
`before it completed execution, SQLCancel
`was called on the hstmt. Then the function
`was called again on the hstmt.
`The function was called and, before it
`completed execution, SQLCancel was
`called on the hstmt from a different thread
`in a multithreaded application.
`
`Page 307 of 434
`
`RA v. AMS
`Ex. 1020
`
`(cid:9)
`(cid:9)
`(cid:9)
`(cid:9)
`(cid:9)
`(cid:9)
`(cid:9)
`(cid:9)
`
`
`SQLSTATE
`
`Error (cid:9)
`
`Description
`
`SQLGetTypelnfo (cid:9)
`
`393
`
`S1010 (cid:9)
`
`Function sequence (cid:9)
`error (cid:9)
`
`S1C00 (cid:9)
`
`Driver not capable (cid:9)
`
`S1T00 (cid:9)
`
`Timeout expired (cid:9)
`
`(DM) An asynchronously executing
`function (not this one) was called for the
`hstmt and was still executing when this
`function was called.
`(DM) SQLExecute, SQLExecDirect, or
`SQLSetPos was called for the hstmt and
`returned SQL_NEED_DATA. This
`function was called before data was sent for
`all data-at-execution parameters or
`columns.
`The value specified for the argument
`fSqlType was in the range of numbers
`reserved for driver-specific SQL data type
`indicators, but was not supported by the
`driver or data source.
`The combination of the current settings of
`the SQL_CONCURRENCY and
`SQL_CURSOR_TYPE statement options
`was not supported by the driver or data
`source.
`The timeout period expired before the data
`source returned the result set. The timeout
`period is set through SQLSetStmtOption,
`SQL_QUERY_TIMEOUT.
`
`Comments
`
`SQLGetTypeInfo returns the results as a standard result set, ordered by
`DATA_TYPE and TYPE_NAME. The following table lists the columns in the
`result set.
`
`Note SQLGetTypelnfo might not return all data types. For example, a driver
`might not return user-defined data types. Applications can use any valid data type,
`regardless of whether it is returned by SQLGetTypelnfo.
`
`The lengths of VARCHAR columns shown in the table are maximums; the actual
`lengths depend on the data source.
`
`Page 308 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`394 (cid:9)
`
`SQLGetTypeInfo
`
`Column Name
`
`TYPE_NAME (cid:9)
`
`DATA_TYPE (cid:9)
`
`PRECISION (cid:9)
`
`LITERAL_PREFIX (cid:9)
`
`LITERAL_SUPP1X (cid:9)
`
`CREATE_PARAMS (cid:9)
`
`Data Type (cid:9)
`
`Comments
`
`Integer (cid:9)
`
`Smallint (cid:9)
`not NULL (cid:9)
`
`Varchar(128) Data source—dependent data type name;
`not NULL (cid:9)
`for example, "CHAR", "VARCHAR",
`"MONEY", "LONG VARBINARY", or
`"CHAR ( ) FOR BIT DATA".
`Applications must use this name in
`CREATE TABLE and ALTER
`TABLE statements.
`SQL data type. This can be an ODBC
`SQL data type or a driver-specific SQL
`data type. For a list of valid ODBC SQL
`data types, see "SQL Data Types" in
`Appendix D, "Data Types." For
`information about driver-specific SQL
`data types, see the driver's
`documentation.
`The maximum precision of the data type
`on the data source. NULL is returned for
`data types where precision is not
`applicable. For more information on
`precision, see "Precision, Scale, Length,
`and Display Size" in Appendix D, "Data
`Types."
`Varchar(128) Character or characters used to prefix a
`literal; for example, a single quote ( ' )
`for character data types or Ox for binary
`data types; NULL is returned for data
`types where a literal prefix is not
`applicable.
`Varchar(128) Character or characters used to terminate
`a literal; for example, a single quote ( ' )
`for character data types; NULL is
`returned for data types where a literal
`suffix is not applicable.
`Varchar(128) Parameters for a data type definition. For
`example, CREATE_PARAMS for
`DECIMAL would be "precision,scale";
`CREATE_PARAMS for VARCHAR
`would equal "max length"; NULL is
`returned if there are no parameters for
`the data type definition, for example
`INTEGER.
`The driver supplies the
`CREATE_PARAMS text in the language
`of the country where it is used.
`
`Page 309 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`Column Name (cid:9)
`
`NULLABLE
`
`Smallint (cid:9)
`not NULL (cid:9)
`
`CASE_SENSITIVE (cid:9)
`
`Smallint (cid:9)
`not NULL (cid:9)
`
`SEARCHABLE (cid:9)
`
`Smallint (cid:9)
`not NULL (cid:9)
`
`UNSIGNED_ATTRIBUTE (cid:9)
`
`Smallint (cid:9)
`
`MONEY (cid:9)
`
`Smallint (cid:9)
`not NULL (cid:9)
`
`SQLGetTypeInfo (cid:9)
`
`395
`
`Data Type (cid:9)
`
`Comments
`
`Whether the data type accepts a NULL
`value:
`SQL_NO_NULLS if the data type does
`not accept NULL values.
`SQL_NULLABLE if the data type
`accepts NULL values.
`SQL_NULLABLE_UNKNOWN if it is
`not known if the column accepts NULL
`values.
`Whether a character data type is case
`sensitive in collations and comparisons:
`TRUE if the data type is a character data
`type and is case sensitive.
`FALSE if the data type is not a character
`data type or is not case sensitive.
`How the data type is used in a WHERE
`clause:
`SQL_UNSEARCHABLE if the data type
`cannot be used in a WHERE clause.
`SQL_LIKE_ONLY if the data type can
`be used in a WHERE clause only with
`the LIKE predicate.
`SQL_ALL_EXCEPT_LIKE if the data
`type can be used in a WHERE clause
`with all comparison operators except
`LIKE.
`SQL_SEARCHABLE if the data type
`can be used in a WHERE clause with
`any comparison operator.
`Whether the data type is unsigned:
`TRUE if the data type is unsigned.
`FALSE if the data type is signed.
`NULL is returned if the attribute is not
`applicable to the data type or the data
`type is not numeric.
`Whether the data type is a money data
`type:
`TRUE if it is a money data type.
`FALSE if it is not.
`
`Page 310 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`396 (cid:9)
`
`SQLGetTypeInfo
`
`Column Name (cid:9)
`
`Data Type (cid:9)
`
`Comments
`
`AUTO_INCREMENT (cid:9)
`
`LOCAL_TYPE_NAME (cid:9)
`
`MINIMUM_SCALE (cid:9)
`
`MAXIMUM_SCALE (cid:9)
`
`Smallint (cid:9)
`
`Whether the data type is
`autoincrementing:
`TRUE if the data type is
`autoincrementing.
`FALSE if the data type is not
`autoincrementing.
`NULL is returned if the attribute is not
`applicable to the data type or the data
`type is not numeric.
`An application can insert values into a
`column having this attribute, but cannot
`update the values in the column.
`Varchar(128) Localized version of the data
`source—dependent name of the data type.
`NULL is returned if a localized name is
`not supported by the data source. This
`name is intended for display only, such
`as in dialog boxes.
`The minimum scale of the data type on
`the data source. If a data type has a fixed
`scale, the MINIMUM_SCALE and
`MAXIMUM_SCALE columns both
`contain this value. For example, an
`SQL_TIMESTAMP column might have
`a fixed scale for fractional seconds.
`NULL is returned where scale is not
`applicable. For more information, see
`"Precision, Scale, Length, and Display
`Size" in Appendix D, "Data Types."
`The maximum scale of the data type on
`the data source. NULL is returned where
`scale is not applicable. If the maximum
`scale is not defined separately on the data
`source, but is instead defined to be the
`same as the maximum precision, this
`column contains the same value as the
`PRECISION column. For more
`information, see "Precision, Scale,
`Length, and Display Size" in Appendix
`D, "Data Types."
`
`Smallint (cid:9)
`
`Smallint (cid:9)
`
`Note The MINIMUM_SCALE and MAXIMUM_SCALE columns were added in
`ODBC 2.0. ODBC 1.0 drivers may return different, driver-specific columns with
`the same column numbers.
`
`Page 311 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`SQLGetTypelnfo (cid:9)
`
`397
`
`Attribute information can apply to data types or to specific columns in a result set.
`SQLGetTypelnfo returns information about attributes associated with data types;
`SQLColAttributes returns information about attributes associated with columns
`in a result set.
`
`Related Functions
`
`For information about
`
`Assigning storage for a column in a result
`set
`Canceling statement processing
`Returning information about a column in a
`result set
`Fetching a block of data or scrolling
`through a result set
`Fetching a row of data
`Returning information about a driver or
`data source
`
`See
`
`SQLBindCol
`
`SQLCancel
`SQLColAttributes
`
`SQLExtendedFetch (extension)
`
`SQLFetch
`SQLGetInfo (extension)
`
`Page 312 of 434
`
`RA v. AMS
`Ex. 1020
`
`(cid:9)
`
`
`398 (cid:9)
`
`SQLMoreResults
`
`SQLMoreResults
`
`Extension Level 2
`
`SQLMoreResults determines whether there are more results available on an
`hstmt containing SELECT, UPDATE, INSERT, or DELETE statements and, if
`so, initializes processing for those results.
`
`Syntax (cid:9)
`
`RETCODE SQLMoreResults(hstmt)
`
`Returns (cid:9)
`
`Diagnostics (cid:9)
`
`The SQLMoreResults function accepts the following argument:
`
`Type (cid:9)
`HSTMT (cid:9)
`
`Argument (cid:9)
`hstmt (cid:9)
`
`Use (cid:9)
`Input (cid:9)
`
`Description
`Statement handle.
`
`SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING,
`SQL_NO_DATA_FOUND, SQL_ERROR, or SQL_INVALID_HANDLE.
`
`When SQLMoreResults returns SQL_ERROR or
`SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained
`by calling SQLError. The following table lists the SQLSTATE values commonly
`returned by SQLMoreResults and explains each one in the context of this
`function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned
`by the Driver Manager. The return code associated with each SQLSTATE value is
`SQL_ERROR, unless noted otherwise.
`
`SQLSTATE (cid:9)
`01000 (cid:9)
`
`Error
`General warning (cid:9)
`
`IM001 (cid:9)
`
`S1000 (cid:9)
`
`S1001 (cid:9)
`
`Driver does not (cid:9)
`support this (cid:9)
`function
`General error (cid:9)
`
`Memory allocation (cid:9)
`failure (cid:9)
`
`Description
`Driver-specific informational message.
`(Function returns
`SQL_SUCCESS_WITH_INFO.)
`(DM) The driver associated with the hstmt
`does not support the function.
`
`An error occurred for which there was no
`specific SQLSTATE and for which no
`implementation-specific SQLSTATE was
`defined. The error message returned by
`SQLError in the argument szErrorMsg
`describes the error and its cause.
`The driver was unable to allocate memory
`required to support execution or completion
`of the function.
`
`Page 313 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`SQLSTATE
`
`Error (cid:9)
`
`Description
`
`SQLMoreResults (cid:9)
`
`399
`
`S1008 (cid:9)
`
`Operation canceled (cid:9)
`
`S1010 (cid:9)
`
`Function sequence (cid:9)
`error (cid:9)
`
`SlT00 (cid:9)
`
`Timeout expired (cid:9)
`
`Asynchronous processing was enabled for
`the hstmt. The function was called and
`before it completed execution, SQLCancel
`was called on the hstmt. Then the function
`was called again on the hstmt.
`The function was called and, before it
`completed execution, SQLCancel was
`called on the hstmt from a different thread
`in a multithreaded application.
`(DM) An asynchronously executing
`function (not this one) was called for the
`hstmt and was still executing when this
`function was called.
`(DM) SQLExecute, SQLExecDirect, or
`SQLSetPos was called for the hstmt and
`returned SQL_NEED_DATA. This
`function was called before data was sent for
`all data-at-execution parameters or
`columns.
`The timeout period expired before the data
`source returned the result set. The timeout
`period is set through SQLSetStmtOption,
`SQL_QUERY_TIMEOUT.
`
`SELECT statements return result sets. UPDATE, INSERT, and DELETE
`statements return a count of affected rows. If any of these statements are batched,
`submitted with arrays of parameters, or in procedures, they can return multiple
`result sets or counts.
`
`If another result set or count is available, SQLMoreResults returns
`SQL_SUCCESS and initializes the result set or count for additional processing.
`After calling SQLMoreResults for SELECT statements, an application can call
`functions to determine the characteristics of the result set and to retrieve data from
`the result set. After calling SQLMoreResults for UPDATE, INSERT, or
`DELETE statements, an application can call SQLRowCount.
`
`If all results have been processed, SQLMoreResults returns
`SQL_NO_DATA_FOUND.
`
`Note that if there is a current result set with unfetched rows, SQLMoreResults
`discards that result set and makes the next result set or count available.
`
`If a batch of statements or a procedure mixes other SQL statements with
`SELECT, UPDATE, INSERT, and DELETE statements, these other statements
`do not affect SQLMoreResults.
`
`Comments
`
`Page 314 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`400 (cid:9)
`
`SQLMoreResults
`
`For additional information about the valid sequencing of result-processing
`functions, see Appendix B, "ODBC State Transition Tables."
`
`Related Functions
`
`For information about
`
`Canceling statement processing
`Fetching a block of data or scrolling
`through a result set
`Fetching a row of data
`Fetching part or all of a column of data
`
`See
`SQLCancel
`SQLExtendedFetch (extension)
`
`SQLFetch
`SQLGetData (extension)
`
`Page 315 of 434
`
`RA v. AMS
`Ex. 1020
`
`(cid:9)
`
`
`SQLNativeSql
`
`SQLNativeSql
`
`401
`
`ODBC 1.0
`
`Extension Level 2 (cid:9)
`
`SQLNativeSql returns the SQL string as translated by the driver.
`
`Syntax
`
`RETCODE SQLNativeSql(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax,
`pcbSqlStr)
`
`The SQLNativeSql function accepts the following arguments:
`
`Type (cid:9)
`HDBC (cid:9)
`UCHAR FAR * (cid:9)
`SDWORD (cid:9)
`UCHAR FAR * (cid:9)
`
`Argument (cid:9)
`hdbc (cid:9)
`szSqlStrIn (cid:9)
`cbSqlStrIn (cid:9)
`szSqlStr (cid:9)
`
`Use (cid:9)
`
`Input (cid:9)
`Input (cid:9)
`Input (cid:9)
`Output (cid:9)
`
`SDWORD (cid:9)
`
`cbSqlStrMax (cid:9)
`
`Input (cid:9)
`
`SDWORD FAR * (cid:9)
`
`pcbSqlStr (cid:9)
`
`Output (cid:9)
`
`Description
`
`Connection handle.
`SQL text string to be translated.
`Length of szSqlStrIn text string.
`Pointer to storage for the
`translated SQL string.
`Maximum length of the szSqlStr
`buffer.
`The total number of bytes
`(excluding the null termination
`byte) available to return in
`szSqlStr. If the number of bytes
`available to return is greater
`than or equal to cbSqlStrMax,
`the translated SQL string in
`szSqlStr is truncated to
`cbSqlStrMax — 1 bytes.
`
`Returns
`
`Diagnostics
`
`SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or
`SQL_INVALID_HANDLE.
`
`When SQLNativeSql returns either SQL_ERROR or
`SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained
`by calling SQLError. The following table lists the SQLSTATE values commonly
`returned by SQLNativeSql and explains each one in the context of this function;
`the notation "(DM)" precedes the descriptions of SQLSTATEs returned by the
`Driver Manager. The return code associated with each SQLSTATE value is
`SQL_ERROR, unless noted otherwise.
`
`Page 316 of 434
`
`RA v. AMS
`Ex. 1020
`
`(cid:9)
`
`
`402 (cid:9)
`
`SQLNativeSql
`
`SQLSTATE
`
`Error
`
`Description
`
`01000
`
`01004
`
`08003
`
`37000
`
`IM001
`
`S1000 (cid:9)
`
`S1001 (cid:9)
`
`S1009 (cid:9)
`
`S1090 (cid:9)
`
`General warning
`
`Data truncated
`
`Connection not
`open
`Syntax error or
`access violation
`
`Driver does not
`support this
`function
`General error
`
`Memory allocation
`failure
`
`Invalid argument
`value
`Invalid string or
`buffer length
`
`Driver-specific informational message.
`(Function returns
`SQL_SUCCESS_WITH_INFO.)
`The buffer szSqlStr was not large enough to
`return the entire SQL string, so the SQL
`string was truncated. The argument
`pcbSqlStr contains the length of the
`untruncated SQL string. (Function returns
`SQL_SUCCESS_WITH_INFO.)
`The hdbc was not in a connected state.
`
`The argument szSqlStrIn contained an SQL
`statement that was not preparable or
`contained a syntax error.
`(DM) The driver associated with the hdbc
`does not support the function.
`
`An error occurred for which there was no
`specific SQLSTATE and for which no
`implementation-specific SQLSTATE was
`defined. The error message returned by
`SQLError in the argument szErrorMsg
`describes the error and its cause.
`The driver was unable to allocate memory
`required to support execution or completion
`of the function.
`(DM) The argument szSqlStrIn was a null
`pointer.
`(DM) The argument cbSqlStrIn was less
`than 0, but not equal to SQL_NTS.
`(DM) The argument cbSqlStrMax was less
`than 0 and the argument szSqlStr was not a
`null pointer..
`
`Comments
`
`The following are examples of what SQLNativeSql might return for the
`following input SQL string containing the scalar function CONVERT. Assume
`that the column empid is of type INTEGER in the data source:
`
`SELECT f fn CONVERT (empid, SQL_SMALLINT) (cid:9)
`
`FROM employee
`
`A driver for SQL Server might return the following translated SQL string:
`
`SELECT convert (smallint, empid) FROM employee
`
`Page 317 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`SQLNativeSql (cid:9)
`
`403
`
`A driver for ORACLE Server might return the following translated SQL string:
`
`SELECT to_number (empid) FROM employee
`
`A driver for Ingres might return the following translated SQL string:
`
`SELECT int2 (empid) FROM employee
`
`Related Functions Norie.
`
`Page 318 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`404 (cid:9)
`
`SQLNumParams
`
`SQLNumParams
`
`Extension Level 2
`
`SQLNumParams returns the number of parameters in an SQL statement.
`
`Syntax (cid:9)
`
`RETCODE SQLNumParams(hstmt, pcpar)
`
`Returns
`
`Diagnostics
`
`The SQLNumParams function accepts the following arguments.
`
`Type (cid:9)
`HSTMT (cid:9)
`SWORD FAR * (cid:9)
`
`Argument (cid:9)
`hstmt (cid:9)
`pcpar (cid:9)
`
`Use (cid:9)
`Input (cid:9)
`Output (cid:9)
`
`Description
`Statement handle.
`Number of parameters in the
`statement.
`
`SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING,
`SQL_ERROR, or SQL_INVALID_HANDLE.
`
`When SQLNumParams returns SQL_ERROR or
`SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained
`by calling SQLError. The following table lists the SQLSTATE values commonly
`returned by SQLNumParams and explains each one in the context of this
`function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned
`by the Driver Manager. The return code associated with each SQLSTATE value is
`SQL_ERROR, unless noted otherwise.
`
`SQLSTATE (cid:9)
`01000 (cid:9)
`
`Error
`General warning (cid:9)
`
`IM001 (cid:9)
`
`S1000 (cid:9)
`
`S1001 (cid:9)
`
`Driver does not (cid:9)
`support this (cid:9)
`function
`General error (cid:9)
`
`Memory allocation (cid:9)
`failure (cid:9)
`
`Description
`Driver-specific informational message.
`(Function returns
`SQL_SUCCESS_WITH_INFO.)
`(DM) The driver associated with the hstmt
`does not support the function.
`
`An error occurred for which there was no
`specific SQLSTATE and for which no
`implementation-specific SQLSTATE was
`defined. The error message returned by
`SQLError in the argument szErrorMsg
`describes the error and its cause.
`The driver was unable to allocate memory
`required to support execution or completion
`of the function.
`
`Page 319 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`SQLSTATE
`
`Error (cid:9)
`
`Description
`
`SQLNumParams (cid:9)
`
`405
`
`S1008 (cid:9)
`
`Operation canceled (cid:9)
`
`S1010 (cid:9)
`
`Function sequence (cid:9)
`error (cid:9)
`
`Si TOO (cid:9)
`
`Timeout expired (cid:9)
`
`Asynchronous processing was enabled for
`the hstmt. The function was called and
`before it completed execution, SQLCancel
`was called on the hstmt. Then the function
`was called again on the hstmt.
`The function was called and, before it
`completed execution, SQLCancel was
`called on the hstmt from a different thread
`in a multithreaded application.
`(DM) The function was called prior to
`calling SQLPrepare or SQLExecDirect
`for the hstmt.
`(DM) An asynchronously executing
`function (not this one) was called for the
`hstmt and was still executing when this
`function was called.
`(DM) SQLExecute, SQLExecDirect, or
`SQLSetPos was called for the hstmt and
`returned SQL_NEED_DATA. This
`function was called before data was sent for
`all data-at-execution parameters or
`columns.
`The timeout period expired before the data
`source returned the result set. The timeout
`period is set through SQLSetStmtOption,
`SQL_QUERY_TIMEOUT.
`
`Comments (cid:9)
`
`SQLNumParams can only be called after SQLPrepare has been called.
`
`If the statement associated with hstmt does not contain parameters,
`SQLNumParams sets pcpar to 0.
`
`Related Functions
`
`For information about (cid:9)
`
`Returning information about a parameter in
`a statement
`Assigning storage for a parameter (cid:9)
`
`See
`SQLDescribeParam (extension)
`
`SQLBindParameter
`
`Page 320 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`406 (cid:9)
`
`SQLNumResultCols
`
`SQLNumResultCols
`
`ODBC 1.0
`
`Core
`
`Syntax
`
`SQLNumResultCols returns the number of columns in a result set.
`
`RETCODE SQLNumResultCols(hstmt, pccol)
`
`Returns
`
`Diagnostics
`
`The SQLNumResultCols function accepts the following arguments.
`
`Type (cid:9)
`HSTMT (cid:9)
`SWORD FAR * (cid:9)
`
`Argument (cid:9)
`
`Use (cid:9)
`
`Description
`
`hstmt (cid:9)
`pccol (cid:9)
`
`Statement handle.
`Input (cid:9)
`Output Number of columns in the
`result set.
`
`SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING,
`SQL_ERROR, or SQL_INVALID_HANDLE.
`
`When SQLNumResultCols returns SQL_ERROR or
`SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained
`by calling SQLError. The following table lists the SQLSTATE values commonly
`returned by SQLNumResultCols and explains each one in the context of this
`function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned
`by the Driver Manager. The return code associated with each SQLSTATE value is
`SQL_ERROR, unless noted otherwise.
`
`SQLSTATE
`
`Error (cid:9)
`
`Description
`
`01000 (cid:9)
`
`General warning (cid:9)
`
`IM001 (cid:9)
`
`S1000 (cid:9)
`
`Driver does not (cid:9)
`support this (cid:9)
`function
`General error (cid:9)
`
`S1001 (cid:9)
`
`Memory allocation (cid:9)
`failure (cid:9)
`
`Driver-specific informational message.
`(Function returns
`SQL_SUCCESS_WITH_INFO.)
`(DM) The driver associated with the hstmt
`does not support the function.
`
`An error occurred for which there was no
`specific SQLSTATE and for which no
`implementation-specific SQLSTATE was
`defined. The error message returned by
`SQLError in the argument szErrorMsg
`describes the error and its cause.
`The driver was unable to allocate memory
`required to support execution or completion
`of the function.
`
`Page 321 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`SQLSTATE
`
`Error (cid:9)
`
`Description
`
`SQLNumResultCols (cid:9)
`
`407
`
`S1008 (cid:9)
`
`Operation canceled (cid:9)
`
`S1010 (cid:9)
`
`Function sequence (cid:9)
`error (cid:9)
`
`S1T00 (cid:9)
`
`Timeout expired (cid:9)
`
`Asynchronous processing was enabled for
`the hstmt. The function was called and
`before it completed execution, SQLCancel
`was called on the hstmt. Then the function
`was called again on the hstmt.
`The function was called and, before it
`completed execution, SQLCancel was
`called on the hstmt from a different thread
`in a multithreaded application.
`(DM) The function was called prior to
`calling SQLPrepare or SQLExecDirect
`for the hstmt.
`(DM) An asynchronously executing
`function (not this one) was called for the
`hstmt and was still executing when this
`function was called.
`(DM) SQLExecute, SQLExecDirect, or
`SQLSetPos was called for the hstmt and
`returned SQL_NEED_DATA. This
`function was called before data was sent for
`all data-at-execution parameters or
`columns.
`The timeout period expired before the data
`source returned the result set. The timeout
`period is set through SQLSetStmtOption,
`SQL_QUERY_TIMEOUT.
`
`SQLNumResultCols can return any SQLSTATE that can be returned by
`SQLPrepare or SQLExecute when called after SQLPrepare and before
`SQLExecute depending on when the data source evaluates the SQL statement
`associated with the hstmt.
`
`Comments
`
`SQLNumResultCols can be called successfully only when the hstmt is in the
`prepared, executed, or positioned state.
`
`If the statement associated with hstmt does not return columns,
`SQLNumResultCols sets pccol to 0.
`
`Page 322 of 434
`
`RA v. AMS
`Ex. 1020
`
`
`
`408 (cid:9)
`
`SQLNumResultCols
`
`Related Functions
`
`For informa