UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

Return Values The following table describes the return values of the SQLTables function. SQLSTATE Values The following table describes the SQLSTATE values. SQLSTAT E Description 1-862 UniBasic Commands Reference Return Value Description 0 SQL.SUCCESS 1 SQL.SUCCESS.WITH.INFO –1 SQL.ERROR –2 SQL.INVALID.HANDLE SQLTables Return Values S1000 General error for which no specific SQLSTATE code has been defined. S1001 Memory allocation failure. S1008 Cancelled. Execution of the statement was stopped by an SQLCancel call. S1010 Function sequence error. The statement.env specified is currently executing an SQL statement. S1C00 The table owner field was not numeric. 24000 Invalid cursor state. Results are still pending from the previous SQL statement. Use SQLCancel to clear the results. 42000 Syntax error or access violation. This can be caused by a variety of reasons. The native error code returned by the SQLError call indicates the specific error that occurred. SQLSTATE Values

SQLTransact Syntax status = SQLTransact (bci.env, connect.env, type) Note: This function is case-sensitive. If you want it to be case-insensitive, you must compile your programs using the BASIC command with the -i option. Description SQLTransact requests a COMMIT or ROLLBACK for all SQL statements associated with a connection or all connections associated with an environment. Use this function only when you are connected to an ODBC data source. This function provides the same transaction functions as the UniBasic statement TRANSACTION COMMIT. When connect.env is a valid connection environment with SQL.AUTOCOMMIT set to OFF, SQLTransact commits the connection. To use SQLTransact, all of the following conditions must be met: The SQL.PRIVATE.TX option of SQLSetConnectOption is set to SQL.PRIVATE.TX.ON. The SQL.AUTOCOMMIT option is set to SQL.AUTOCOMMIT.OFF. The connection is active. Setting bci.env to a valid environment handle and connect.env to SQL.NULL.HDBC requests the server to try to execute the requested action on all hdbcs that are in a connected state. If any action fails, SQL.ERROR is returned, and the user can determine which connections failed by calling SQLError for each connection environment in turn. If you call SQLTransact with a type of SQL.COMMIT or SQL.ROLLBACK when no transaction is active, SQL.SUCCESS is returned. SQLTransact 1-863

SQLTransact<br />

Syntax<br />

status = SQLTransact (bci.env, connect.env, type)<br />

Note: This function is case-sensitive. If you want it to be case-insensitive, you<br />

must compile your programs using the BASIC command with the -i option.<br />

Description<br />

SQLTransact requests a COMMIT or ROLLBACK for all SQL statements<br />

associated with a connection or all connections associated with an environment. Use<br />

this function only when you are connected to an ODBC data source.<br />

This function provides the same transaction functions as the <strong>UniBasic</strong> statement<br />

TRANSACTION COMMIT. When connect.env is a valid connection environment<br />

with SQL.AUTOCOMMIT set to OFF, SQLTransact commits the connection.<br />

To use SQLTransact, all of the following conditions must be met:<br />

The SQL.PRIVATE.TX option of SQLSetConnectOption is set to<br />

SQL.PRIVATE.TX.ON.<br />

The SQL.AUTOCOMMIT option is set to SQL.AUTOCOMMIT.OFF.<br />

The connection is active.<br />

Setting bci.env to a valid environment handle and connect.env to SQL.NULL.HDBC<br />

requests the server to try to execute the requested action on all hdbcs that are in a<br />

connected state.<br />

If any action fails, SQL.ERROR is returned, and the user can determine which<br />

connections failed by calling SQLError for each connection environment in turn.<br />

If you call SQLTransact with a type of SQL.COMMIT or SQL.ROLLBACK when<br />

no transaction is active, SQL.SUCCESS is returned.<br />

SQLTransact 1-863

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!