db_command

Sends a DBMS driver command.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

void db_command(command,spec)
int             command
string          spec

Description

Sends the specified command to the DBMS driver. The command values are defined in the trim.h file. The spec string contains the values appropriate for the command.
command specifies the DBMS driver command.
Cmd Parms DBMS Duration Default Description
db_cmd_timeoutnAllSessionDiffers Set resource timeout to n seconds.
db_cmd_singlepidyes|noSybaseSessionNo Use a single PID within a transaction.
db_cmd_usedbdbnameSybaseSessionN/A Use database dbname.
db_cmd_languagelanguageOracleSessionSee oparse() or StmtPrepare Set SQL syntax and datatypes.
db_cmd_raw_datatypeyes|noAllSessionno Return raw datetime.
db_cmd_chardtyOracleSession1 Map VORTEX char type to Oracle type dty.
db_cmd_lockN/AAllCallN/A Lock VORTEXaccelerator slave on next call.
db_cmd_onebyteyes|noSybaseSessionNo Return single blanbk varchar as blank instead of null.
db_cmd_multistmtyes|noSybaseSessionNo Batch INSERT, UPDATE, and DELETE statements.
db_cmd_autocommiton|offGENESISSessionoff Automatically commit after every SQL statement.
db_cmd_dormantN/AInformixUntil next useN/A Sets the current connection to dormant.
db_cmd_getldaN/AOracleCallN/A Returns the address of the LDA on Oracle 7 only.
db_cmd_raisevalueTRIMrpcCallN/A Cause a raise(value) error condition.
db_cmd_errormessageTRIMrpcCallN/A Return the message as an error.
db_cmd_tmp_releaseN/AVORTEXwebdCallN/A Execute a temporary release.
db_cmd_worm_authvalueGENESIS/SDMSSessionN/A Call sdms2_initx() using value.
db_cmd_timeout_querynGENESISSession2 Set query timeout to n seconds
db_cmd_timeout_fetchnGENESIS/SDMSSession2 Set fetch timeout to n seconds
db_cmd_dyn_cursoryes|noODBCSessionconnection default Use dynamic cursors.
db_cmd_syntax_levelN/AGENESISSessionN/A Return GENESIS syntax level.
db_cmd_return_rowidyes|noAllSessionyes Return ROWID on insert.
db_cmd_new_blobsyes|noOracleSessionno Use BLOB/CLOB instead of LONG RAW/LONG.
db_cmd_ro_cursoryes|noODBCSessionno Use read-only cursors.
db_cmd_cursor_typecursor typeODBCSessionSQL_CURSOR_TYPE_DEFAULT Set the ODBC cursor type to one of:
SQL_CURSOR_STATIC
SQL_CURSOR_KEYSET_DRIVER
SQL_CURSOR_DYNAMIC
SQL_CURSOR_FORWARD_ONLY.
db_cmd_txn_isolevelisolation typeODBCSessionN/A Set the ODBC isolation type to one of:
SQL_TXN_READ_UNCOMMITTED
SQL_TXN_READ_COMMITTED
SQL_TXN_REPEATABLE_READ
SQL_TXN_SERIALIZABLE.
db_cmd_scrollscroll optionOracle
Informix
DB2
AdabasD
ODBC
CursorN/A Set the scrolling direction or position of a scrollable cursor (see VTXOPEN). Scroll options are defined in vortex.h as TDB_SMD_SCROLL_xx.
db_cmd_hostnameN/AAllN/AN/AReturn the hostname of the machine where the DBMS driver is running.
db_cmd_fqcolnameyes|noAllSessionnoReturn fully qualified column names.
db_cmd_free_locksN/AODBCCursorN/AFree the locks held by the cursor.
db_cmd_nounicharyes|noODBC
SQL Server
SessionnoDescribe W[VAR]CHAR columns as CHAR.
db_cmd_zerolen_nullyes|noODBC
SQL Server
SessionnoForce zero length parameter strings to be bound as NULL.
db_cmd_exio_rsyes|noDB2SessionnoProcess stored procedure cursors with EXIO.
db_cmd_drv_configN/AN/AN/AN/AInternal use only.
db_cmd_bld_minnPostgreSQLSession10Minimum numbers of rows for bulk insert.
db_cmd_max_col_lennPostgreSQLSession65535maximum column length.
db_cmd_set_con_attrattr valueODBC
DB2
SQL Server
SessionN/ASet the connection attribute to value.
db_cmd_get_con_attrattrODBC
DB2
SQL Server
SessionN/ARetrieve the value for the connection attribute.
db_cmd_desc_parmsyes|noSQL ServerSessionnoUse SQLDescribeParam for parameters.
db_cmd_desc_lobsyes|noAllSessionnoDescribe LOB select list columns as BLOB/CLOB; otherwise max 65k BINARY/CHAR.
spec specifies the command modifiers.

Examples

Notify the DBMS to not return the inserted row's ROWID value.
db_command(db_cmd_return_rowid,"NO");
exec_sql("insert into staff values(:1,:2,:3,:4,:5,:6,:7)",ll);
db_command(db_cmd_return_rowid,"YES");