Creates a hash data structure understood by the ODBC DBI driver when binding values in SQL queries that allows programmers to directly specify the ODBC data type for the bind.
Use the Type Constants for odbc_bind() to specify the ODBC data type for the bind. If the value to bind is NOTHING
or NULL
, a NULL
will be bound as the value, regardless of the ODBC type code provided as the first argument.
- Code Flags:
- RET_VALUE_ONLY
- Parameters
-
type | the type code for the ODBC type to bind |
value | the value to bind |
- Returns
- The hash returned by the function encodes the desired ODBC type for the bind and the value for binding in the
"^odbct^"
and "^value^"
keys
- Example:
# we use odbc_bind() to bind a SQL_DATE type by value, otherwise the ODBC module would try to send the date as SQL_TIMESTAMP instead which could change the date value depending on currently set timezone and timezone of the ODBC connection
date d = 2016-1-14;
- Exceptions
-
DBI:ODBC:BIND-ERROR | if the type argument is 0 this exception is raised |