Home > Contents > Index >
Template Tag TOC  |   Alpha TOC  |   Tag Family TOC  |   Purpose TOC  |   Annotated TOC  |   Index 

 

ICS.SELECTTO

Executes a simple query from a table.

Syntax

Parameters

TABLE(required)
Name of the Content Server table to query. The table must be registered in the SystemInfo table. This table verifies security and caches result sets when the cc.cacheResults property is enabled.

WHAT (optional)
List of columns to return. This parameter accepts a comma-separated list of column names.

LISTNAME(required)
Name of the list to contain the resultset.

WHERE(optional)
Comma-separated list of table columns to select against. For each item in the where string, the value of the corresponding variable is used to construct a SQL where clause. All the elements in the comma-separated list must be variables. When you specify a datetime field as the where criteria, Content Server uses the cc.datepicture property to convert the supplied datetime to the proper format.

ORDERBY (optional)
Orders the rows returned by the query. The format of orderby is a comma-separated list of column names. You can also override the default sort order by specifying ascending/descending with a (potentially) database specific command like:

LIMIT(optional)
Maximum number of rows to return. Note that if the limit parameter is omitted or is less than or equal to 0, then no limit exists and the entire recordset is returned.

Description

The ics:selectto tag executes a simple query from a table. The results are stored in a list.

errno

The possible values of errno include:

Value
Description
-101
No search results.
-10005
One of the elements in the WHERE clause was not a variable. (All elements in the WHERE clause must be variables.). Other possible causes include missing parameters for the tag.

Example

The following example lists out the table names for which the systable column has the value obj. The table names are retrieved from the SystemInfo table.


<SETVAR NAME="systable" VALUE="obj" />

<ICS.SELECTTO TABLE="SystemInfo" WHAT="tblname" LIMIT="-1" WHERE="systable" ORDERBY="tblname desc"/>
		The number of rows retrieved is <ICS.LISTGET LISTNAME="my_output" FIELDNAME="#numRows" />
		The errno is <CSVAR NAME="Variables.errno" />
<LOOP LIST="my_output">
		Name : <ICS.LISTGET LISTNAME="my_output" FIELDNAME="tblname" />
</LOOP>


  Home > Contents > Index >

FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.