Home > Contents > Index >
CALLSQL
Retrieves and executes an SQL query stored in the
SystemSQL
table.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
CALLSQL
tag retrieves and executes an SQL query stored in theSystemSQL
table. The resultset of the query is cached against the table name specified for the query in theSystemSQL
table. 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
errno
include:
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
gettables
and stores the resultset innewrs
. Thetblname
anddefdir
for each row innewrs
are 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, 2018, Oracle and/or its affiliates. All rights reserved.