UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
SQLExecDirect Syntax status = SQLExecDirect (statement.env, statement) 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 SQLExecDirect accepts an SQL statement or procedure call and delivers it to the data source for execution. It uses the current values of any SQL statement parameter markers. SQLExecDirect differs from SQLExecute in that it does not require a call to SQLPrepare. SQLExecDirect prepares the SQL statement or procedure call implicitly. Use SQLExecDirect when you do not need to execute the same SQL statement or procedure repeatedly. You can use parameter markers in the SQL statement or procedure call as long as you have resolved each marker with an SQLBindParameter call. After an SQLExecDirect call you can use SQLNumResultCols, SQLDescribeCol, SQLRowCount, or SQLColAttributes to get information about the resulting columns. You can use SQLNumResultCols to determine if the SQL statement or procedure call created a result set. If the executed SQL statement or procedure produces a set of results, you must use an SQLFreeStmt call with the SQL.CLOSE option before you execute another SQL statement or procedure call using the same SQL statement environment. The SQL.CLOSE option cancels any pending results still waiting at the data source. 1-810 UniBasic Commands Reference
Your application programs should not try to issue transaction control statements directly to the data source (for instance, by issuing a COMMIT statement with SQLExecDirect or SQLPrepare). Programs should use only UniBasic transaction control statements. UniData BCI issues the correct combination of transaction control statements and middleware transaction control function calls that are appropriate for the DBMS you are using. Trying to use SQLExecDirect to execute explicit transaction control statements on ODBC data sources can cause unexpected results and errors. When SQLExecDirect calls a procedure, it does not begin a transaction. If a transaction is active when a procedure is called, the current transaction nesting level is maintained. Note: If you execute a stored procedure or enter a command batch with multiple SELECT statements, the results of only the first SELECT statement are returned. Parameters The following table describes each parameter of the syntax. Parameter Description statement.env SQL statement environment from a previous SQLAllocStmt. SQLExecDirect Input Variables SQLExecDirect 1-811
- Page 802 and 803: SOAPSetDefault Syntax SOAPSetDefaul
- Page 804 and 805: Along with SOAPSetDefault, the Call
- Page 806 and 807: Return Codes The return code indica
- Page 808 and 809: Return Codes The return code indica
- Page 810 and 811: Return Codes The return code indica
- Page 812 and 813: You can also use the UniBasic STATU
- Page 814 and 815: Return Codes The return code indica
- Page 816 and 817: SOUNDEX Syntax SOUNDEX(expr) Descri
- Page 818 and 819: SPACE Syntax SPACE(expr) Descriptio
- Page 820 and 821: SPLICE Syntax SPLICE(expr1,"expr",
- Page 822 and 823: SQLAllocConnect Syntax status = SQL
- Page 824 and 825: SQLAllocEnv Syntax status = SQLAllo
- Page 826 and 827: SQLAllocStmt Syntax status = SQLAll
- Page 828 and 829: SQLBindCol Syntax status = SQLBindC
- Page 830 and 831: SQLBindParameter Syntax status = SQ
- Page 832 and 833: Parameters The following table desc
- Page 834 and 835: SQLCancel Syntax status = SQLCancel
- Page 836 and 837: SQLColAttributes Syntax status = SQ
- Page 838 and 839: 1-796 UniBasic Commands Reference C
- Page 840 and 841: SQLColumns Syntax status = SQLColum
- Page 842 and 843: Return Values The following table d
- Page 844 and 845: Parameter Description Return Values
- Page 846 and 847: Parameter Description Return Values
- Page 848 and 849: Return Values The following table d
- Page 850 and 851: ODBC Data Sources When a program is
- 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
Your application programs should not try to issue transaction control statements<br />
directly to the data source (for instance, by issuing a COMMIT statement with<br />
SQLExecDirect or SQLPrepare). Programs should use only <strong>UniBasic</strong> transaction<br />
control statements. UniData BCI issues the correct combination of transaction<br />
control statements and middleware transaction control function calls that are appropriate<br />
for the DBMS you are using. Trying to use SQLExecDirect to execute explicit<br />
transaction control statements on ODBC data sources can cause unexpected results<br />
and errors.<br />
When SQLExecDirect calls a procedure, it does not begin a transaction. If a transaction<br />
is active when a procedure is called, the current transaction nesting level is<br />
maintained.<br />
Note: If you execute a stored procedure or enter a command batch with multiple<br />
SELECT statements, the results of only the first SELECT statement are returned.<br />
Parameters<br />
The following table describes each parameter of the syntax.<br />
Parameter Description<br />
statement.env SQL statement environment from a previous SQLAllocStmt.<br />
SQLExecDirect Input Variables<br />
SQLExecDirect 1-811