Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
ICS.SelectTo
Performs a simple query from a table.
Syntax
public IList SelectTo(String from, String what, String where, String orderby, int limit, String listname, boolean bCache, StringBuffer errstr)Parameters
from- Table to query. The table must exist.
what- Comma-separated list of table columns to return. The string * means all columns.
where- Comma-separated list of column names which must have associated variables. The value of the variable is used to match the contents of that column. The variables in the comma-separated list must exist; if they do not,
ICS.SelectTo()returns error-106. When you specify a date/time field inwhere, Sites uses thecc.datepictureproperty to convert the supplied datetime to the proper format.
orderby- Comma-separated list of columns used to sort results. The
ascending/descending order is database-dependent.
limit- The maximum number of rows returned from the query. To indicate no limit, set this value to -1.
listname- The name of the list created. The list can be referenced using this name from an XML tag or by using the
getListmethod. If no listname is specified, the system will generate the name of the list.
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.
errstr- For return values; may contain error information.
Description
The
SelectTomethod performs a simple query from a table. The results are stored in a list.Returns
IListobject that contains the results. An empty result set returns a value of null.Error Numbers
If
IListisnull, useto find the error.GetErrnoExample
// If forumId isn't set, list all forums if (forumId != null) { ics.SetVar(Msg.forumid, forumId); mList = ics.SelectTo(Msg.forumXTable, Msg.allFields, (forumId == null) ? null : Msg.forumid, null, Msg.noLimit, null, Msg.cacheResults, errstr); } if (mList != null) { mColNames = Utilities.words(forumCols, Msg.comma); mCols = mColNames.size(); }See Also
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.