odbc_setoptionPHP ManualPrevNextodbc_setoptionodbc_setoption --
Adjust ODBC settings. Returns false if an error occurs, otherwise
true.
Descriptionint odbc_setoption(int id, int function, int option, int param);
This function allows fiddling with the ODBC options for a
particular connection or query result. It was written to help
find work arounds to problems in quirky ODBC drivers. You
should probably only use this function if you are an ODBC
programmer and understand the effects the various options will
have. You will certainly need a good ODBC reference to explain
all the different options and values that can be used.
Different driver versions support different options.
Because the effects may vary depending on the ODBC driver, use
of this function in scripts to be made publicly available is
strongly discouraged. Also, some ODBC options are not available
to this function because they must be set before the connection
is established or the query is prepared. However, if on a
particular job it can make PHP work so your boss doesn't tell
you to use a commercial product, that's all that really matters.
Id is a connection id or result id on
which to change the settings.For SQLSetConnectOption(), this is
a connection id. For SQLSetStmtOption(), this is a result id.
function is the ODBC function to use. The
value should be 1 for SQLSetConnectOption() and 2 for
SQLSetStmtOption().
Parmeter option is the option to set.
Parameter param is the value for the
given option.
Example 1. ODBC Setoption Examples 1
2 // 1. Option 102 of SQLSetConnectOption() is SQL_AUTOCOMMIT.
3 // Value 1 of SQL_AUTOCOMMIT is SQL_AUTOCOMMIT_ON.
4 // This example has the same effect as
5 // odbc_autocommit($conn, true);
6
7 odbc_setoption ($conn, 1, 102, 1);
8
9 // 2. Option 0 of SQLSetStmtOption() is SQL_QUERY_TIMEOUT.
10 // This example sets the query to timeout after 30 seconds.
11
12 $result = odbc_prepare ($conn, $sql);
13 odbc_setoption ($result, 2, 0, 30);
14 odbc_execute ($result);
15 PrevHomeNextodbc_rollbackUpOracle functions
Wyszukiwarka
Podobne podstrony:
function odbc setoptionfunction odbc setoptionfunction odbc binmodefunction odbc longreadlenfunction odbc close allfunction odbc connectfunction odbc gettypeinfofunction odbc tableprivilegesfunction curl setoptfunction odbc execfunction odbc binmodewięcej podobnych podstron