UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
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
- Page 854 and 855: Parameter Description Return Values
- Page 856 and 857: SQLExecute tells the data source to
- Page 858 and 859: Return Values The following table d
- Page 860 and 861: Return Values The following table d
- Page 862 and 863: Return Values The following table d
- Page 864 and 865: Parameters The following table desc
- Page 866 and 867: SQLGetInfo Syntax status = SQLGetIn
- Page 868 and 869: 1-826 UniBasic Commands Reference S
- Page 870 and 871: Return Values The following table l
- Page 872 and 873: Parameters The following table desc
- Page 874 and 875: 1-832 UniBasic Commands Reference C
- Page 876 and 877: SQLNumParams Syntax status = SQLNum
- Page 878 and 879: SQLNumResultCols Syntax status = SQ
- Page 880 and 881: SQLParamOptions Syntax status = SQL
- Page 882 and 883: Example This example shows how you
- Page 884 and 885: ODBC Data Sources If you execute a
- Page 886 and 887: SQLRowCount Syntax status = SQLRowC
- Page 888 and 889: SQLSetConnectOption Syntax status =
- Page 890 and 891: Return Values The following table d
- Page 892 and 893: SQLSetParam SQLSetParam is a synony
- Page 894 and 895: For complete details about the SQLS
- Page 896 and 897: 1-854 UniBasic Commands Reference C
- Page 898 and 899: Parameter Description tablename Nam
- Page 900 and 901: TYPE Smallint Not null 1-858 UniBas
- Page 902 and 903: SQLTables Syntax status = SQLTables
- Page 906 and 907: Parameters The following table desc
- Page 908 and 909: SQRT Syntax SQRT(num.expr) Descript
- Page 910 and 911: SSUB Syntax SSUB(x, y) Description
- Page 912 and 913: STOP Syntax STOP [expr] Description
- Page 914 and 915: STR Syntax STR(str.expr, num.expr)
- Page 916 and 917: STRS Syntax STRS(dyn.array, expr) D
- Page 918 and 919: If the response status indicates th
- Page 920 and 921: SUBROUTINE Syntax SUBROUTINE sub.na
- Page 922 and 923: SUBROUTINE (Update Trigger) Syntax
- Page 924 and 925: Tip: The UniBasic STATUS function r
- Page 926 and 927: SUBROUTINE (Delete Trigger) Syntax
- Page 928 and 929: Tip: The UniBasic STATUS function r
- Page 930 and 931: Related Commands UniBasic DEL, INSE
- Page 932 and 933: Examples In the following example,
- Page 934 and 935: In the next example, SWAP does not
- Page 936 and 937: Parameter Description 1-894 UniBasi
- Page 938 and 939: Parameter Description 1-896 UniBasi
- Page 940 and 941: TAN Syntax TAN(num.expr) Descriptio
- Page 942 and 943: TIMEDATE Syntax TIMEDATE( ) Descrip
- Page 944 and 945: Example In the following example, t
- Page 946 and 947: Parameters The following table desc
- Page 948 and 949: TRANSACTION START Syntax TRANSACTIO
- Page 950 and 951: TRIM Syntax TRIM(str.expr[,char[,ty
- Page 952 and 953: Related Commands UniBasic TRIMB, TR
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