Home > Contents > Index >
CALLSQL
Retrieves and executes an SQL query stored in the
SystemSQLtable.Syntax
<CALLSQL QRYNAME="QRY_NAME" LIST="LIST" [LIMIT="MAX_NO_RESULTS"]/>Parameters
QRYNAME (required)- Name of query to retrieve and execute.
LIST (required)- Name of list to contain resultset.
LIMIT (optional)- Maximum number of rows in the resultset. Note that there is no limit if the parameters are missing or set to a negative number.
Description
The
CALLSQLtag retrieves and executes an SQL query stored in theSystemSQLtable. The resultset of the query is cached against the table name specified for the query in theSystemSQLtable. The table name must exist in the database prior to callingCALLSQL.
Note
The deftable column in the SystemSQL table can specify a comma-separated list of table names.
Error Numbers
The possible values of
errnoinclude:
Value Description -15 No file found. -101 No rows found. -102 Empty column. -103 No such table. -104 No table definition. -106 Bad parameter.Example
This example executes a query called
gettablesand stores the resultset innewrs. Thetblnameanddefdirfor each row innewrsare displayed.<SETVAR NAME="errno" VALUE="0"/> <CALLSQL QRYNAME="gettables" LIST="newrs"/> <LOOP LIST="news"> Tablename: <CSVAR NAME="newrs.tblname"/> Directory: <CSVAR NAME="newrs.defdir"/> </LOOP> <IF COND="IsError.Variables.errno=true"> <THEN> <!--Handle error--> </THEN> </IF>See Also
EXECSQL
RENAMELIST
SELECTTO
ICS.LITERAL
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.