Creates a hash data structure understood by the pgsql DBI driver when binding values in SQL queries that allows programmers to directly specify the PostgreSQL data type for the bind.
Use the Type Constants for pgsql_bind() to specify the PostgreSQL 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 PostgreSQL type code provided as the first argument.
- Code Flags:
- RET_VALUE_ONLY
- Parameters
-
type | the type code for the PostgreSQL type to bind |
value | the value to bind |
- Returns
- The hash returned by the function encodes the desired PostgreSQL type for the bind and the value for binding in the
"^pgtype^"
and "^value^"
keys
- Example:
# we use pgsql_bind() to bind a money type by value, otherwise the server would raise an error
my float $amount = 400.56;
- Exceptions
-
PGSQL-BIND-ERROR | if the type argument is 0 this exception is raised |