f$SQLConnectOpt
f$SQLConnectOpt
Add a connection property for the ODBC connection. The following properties are possible:
SQL_ACCESS_MODE | 101 |
SQL_AUTOCOMMIT | 102 |
SQL_LOGIN_TIMEOUT | 103 |
SQL_OPT_TRACE | 104 |
SQL_OPT_TRACEFILE | 105 |
SQL_TRANSLATE_DLL | 106 |
SQL_TRANSLATE_OPTION | 107 |
SQL_TXN_ISOLATION | 108 |
SQL_CURRENT_QUALIFIER | 109 |
SQL_ODBC_CURSORS | 110 |
SQL_QUIET_MODE | 111 |
SQL_PACKET_SIZE | 112 |
Details for these expert modes can be found in the help file for the ODBC driver used.
The attribute is important:
SQL_AUTOCOMMIT | Turn on (1) or off (0) automatic committing for every SQL command. If this mode is used, it must be ensured that the SQL commands are confirmed (COMMIT) or discarded (ROLLBACK) for the desired times. |
Function description:
Syntax: | Status = f$SQLConnectOpt( Channel, Option, Value ) | ||
| Argument | Type | Meaning |
| Channel | Integer | Channel number for the SQL connection |
| Option | Integer | Option to be added, e.g. 102, for managing transactions manually |
| Value | Integer | Option value ( e.g. 0 to deactivate automatic transactions) |
Result: | Integer | Error status: 0 – command was resolved correctly, -9999: the option was not added. | |
Example: | Channel = f$SQLConnect( db, user, password ) All addresses are now locked. Status = f$SQLTransact(Channel,0) All addresses are now available again. Status = f$SQLDisconnect( Channel ) | ||
| Note: the instruction at the end of the Select command: for Update NoWait is suitable for when using an Oracle database in order to lock the data records to be modified later while reading. | ||