Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
ICS.SQL
Executes a SQL statement.
Syntax
public IList SQL(String from, String sqlstmt, String listname, int limit, boolean bCache, StringBuffer errstr)Parameters
from- The name of the table(s) to which the resultset should be cached. To specify multiple tables, separate the table names with commas. For example, the following string tells the SQL method to cache the resultset in tables named
applesandbananas:
"apples,bananas"- If you specify multiple tables, the first table listed is the "primary" table, meaning that the resultset will be cached based on that table's caching rules (maximum cache size, timeout, and so on).
sqlstmt- The SQL statement to execute.
listname- The name of the list created. The list can be referenced using this name from an XML tag or using the
GetListmethod. If you specifynull, SQL will generate the name of the list for you.
limit- The maximum number of rows returned from the query. To indicate no limit, set this value to
-1.
bCachetrueto cache the results;falseotherwise. Regardless of the value ofbCache, the existing cache will be used to generate the return value, but new resultsets will not be cached. SettingbCacheto false can hurt performance.
errstr- For return values; may contain error information.
Description
The
SQLmethod executes a SQL statement.The SQL query may be database-specific. The resultset associated with the query is registered against the table(s) specified in the
fromparameter.The SystemSQL table allows the specification of the name of the table to cache the results of the query. The resultset associated with the query is registered against the table name designated in the SystemSQL table.
Returns
IListobject containing the results. When certain SQL statements (delete, update, and so on) are executed successfully, no resultset, and hence noIList, is returned.Error Numbers
If
IListisnull, useto find the error. When certain SQL statements (GetErrnodelete,update, and so on) are executed successfully, no resultset, and hence noIList, is returned. If noIListis returned,to find the error. When certain SQL statements (delete,update, and so on) are executed successfully, no resultset, and hence noIList, is returned. If noIListis returned, GetErrno returns error number-502. This does not necessarily indicate an error condition.Example
See the example for SQLExp .
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.