BindHostVariable()


" "

short BindHostVariable(BSTR CollectionName, BSTR PackageName, short SectionNumber, 
 short Number, BSTR Name, short DataType, short Length)

Description

This function binds a variable in the specified section. Include the text ":H" in the SQL text as a placeholder for a host variable. For each non-decimal host variable in the SQL text, you should call BindHostVariable() to specify information about the variable.

Parameters


Name Description
CollectionName The collection ID of the package that you want to bind.
PackageName The name of the package that you want to bind.
SectionNumber The section number of the statement within the collection and package that you want to bind.
Number The identifier for the variable you want to bind. The first variable in the SQL statement is variable 0. Each subsequent variable is numbered sequentially.
Name Used by the database server for diagnostic purposes. This value is not validated nor required by QMF for Windows.
DataType

The SQL data type of the variable. Valid values for DataType include:

384 (RSDT_DATE) -- Date
388 (RSDT_TIME) -- Time
392 (RSDT_TIMESTAMP) -- Timestamp
396 (RSDT_DATALINK) -- Datalink
404 (RSDT_BLOB) -- Binary large object
408 (RSDT_CLOB) -- Character large object
412 (RSDT_DBCLOB) -- Double-byte character large object
448 (RSDT_VARCHAR) -- Variable length character string
452 (RSDT_CHAR) -- Character string
456 (RSDT_LONGVARCHAR) -- Long varying length character string
464 (RSDT_VARGRAPHIC) -- Varying length graphic string
468 (RSDT_GRAPHIC) -- Graphic string
472 (RSDT_LONGVARGRAPHIC) -- Long varying length graphic string
480 (RSDT_FLOAT) -- Floating point number
484 (RSDT_DECIMAL) -- Decimal number
492 (RSDT_BIGINT) -- 8-byte integer
496 (RSDT_INTEGER) -- 4-byte integer
500 (RSDT_SMALLINT) -- 2-byte integer
916 (RSDT_BLOBFILEFREF) -- Binary large object file reference
920 (RSDT_CLOBFILEREF) -- Character large object file reference
924 (RSDT_DBCLOBFILEREF) -- Double-byte character large object file reference
904 (RSDT_ROWID) -- Row identifier
960 (RSDT_BLOBLOCATOR) -- Binary large object locator
964 (RSDT_CLOBLOCATOR) -- Character large object locator
968 (RSDT_DBCLOBLOCATOR) -- Double-byte large object locator

Length The length of the variable.

Return Value

The return value will be zero if successful or non-zero if unsuccessful. If the return value is non-zero, you can call GetLastErrorString(), GetLastErrorType(), GetLastSQLCode(), GetLastSQLError(), or GetLastSQLState() to get additional error information.