odbc-get-field ( statement column! -- field )


Vocabulary
odbc

Inputs
statementan ODBC statement handle
column!a column number starting from one or a <column> object


Outputs
fielda <field> object


Word description
Returns a field object which contains the data for the field in the given column in the current row. The column can be identified by a number or a <column> object. The datatype of the contents of the field depends on the type of the column itself. Note that this word can only be safely called once on each column in a given row with most ODBC drivers. Subsequent calls on the same row for the same column can fail.

See also
odbc-init, odbc-connect, odbc-disconnect, odbc-prepare, odbc-free-statement, odbc-execute, odbc-next-row, odbc-number-of-columns, odbc-describe-column, odbc-get-field, odbc-get-row-fields, odbc-get-all-rows, odbc-query

Definition


:: odbc-get-field ( statement column! -- field )
column column?
[ statement column odbc-describe-column column! ] unless
8192 :> bufferLen bufferLen alien-space-str
:> targetValuePtr statement column number>> SQL_C_DEFAULT
targetValuePtr bufferLen 0 SQLINTEGER <ref>
:> outlen outlen SQLGetData succeeded? [
outlen SQLINTEGER deref -1 =
[ f column <field> ] [
targetValuePtr column dereference-type-pointer
column <field>
] if
] [ statement throw-statement-error ] if ;