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

Related Commands UniBasic COMMON, EXECUTESQL, MDPERFORM, PCPERFORM, UDTEXECUTE UniData STACKCOMMON – For more information, see the UniData Commands Reference. 1-270 UniBasic Commands Reference

EXECUTESQL Syntax EXECUTESQL str.expr [ASYNC | SYNC] [ON connection [ON ERROR statements]] Description The UniBasic EXECUTESQL command executes a UniData SQL statement within a UniBasic program. If the UniData SQL statement includes a SELECT statement with the intent to process internal program items, the SELECT statement must contain a TO clause with a resulting file name. Otherwise, UniData displays the result of the statement. If you select only the @ID attribute, UniData stores the @IDs in a select list. If the UniData SQL statement includes a TO clause, the data is stored in the output file and is then available to the UniBasic program via the READNEXTTUPLE statement. Note: After you execute a SELECT statement and complete processing of the selected records, you must execute the CLEARSQL command to clear the select list and make all records in the file available for further processing. Parameters The following table describes each parameter of the syntax. Parameter Description str.expr Specifies a valid UniData SQL statement for UniData to execute. EXECUTESQL Parameters EXECUTESQL 1-271

EXECUTESQL<br />

Syntax<br />

EXECUTESQL str.expr [ASYNC | SYNC] [ON connection [ON ERROR<br />

statements]]<br />

Description<br />

The <strong>UniBasic</strong> EXECUTESQL command executes a UniData SQL statement within<br />

a <strong>UniBasic</strong> program.<br />

If the UniData SQL statement includes a SELECT statement with the intent to<br />

process internal program items, the SELECT statement must contain a TO clause<br />

with a resulting file name. Otherwise, UniData displays the result of the statement. If<br />

you select only the @ID attribute, UniData stores the @IDs in a select list. If the<br />

UniData SQL statement includes a TO clause, the data is stored in the output file and<br />

is then available to the <strong>UniBasic</strong> program via the READNEXTTUPLE statement.<br />

Note: After you execute a SELECT statement and complete processing of the selected<br />

records, you must execute the CLEARSQL command to clear the select list and make<br />

all records in the file available for further processing.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

str.expr Specifies a valid UniData SQL statement for UniData to<br />

execute.<br />

EXECUTESQL Parameters<br />

EXECUTESQL 1-271

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

Saved successfully!

Ooh no, something went wrong!