Home > Contents > Index >
ics:sqlexp
Passes a column name and an expression that contains the column name to be used as the left side in the where clause.
Syntax
<ics:sqlexp column="column name" output="variable name" string="string" table="table name" [type="logical operator"] verb="comparison operator" [expression="expression"]/>Parameters
column (required)
- Name of the column in the table.
output (required)
- Name of the output variable.
string (required)
- Value or values to compare against.
table (required)
- Name of the table.
type (optional)
- Logical operator to use between. Default is
and
.
verb (required)
- Comparison operator.
expression (optional)
- Column expression to be used instead of column name.
Error Numbers
The possible values of
errno
include:
Value Description -100 Exception error -103 Invalid table name -106 Bad parameter value -406 Bad parameter value -10004 Missing required attribute
Description
This tag was introduced in CS release 5.0. The sqlexp tag is only used to build a where clause based on the given set of parameters. It does not execute any statement. This tag has a different functionality in comparison with its peers: ics:selectto, ics:callsql, ics:sql tags.
- ics:selectto tag is used to select rows from a table based on the given conditions.
- ics:callsql tag retrieves and executes a SQL query stored in the system SQL table
- ics:sql tag executes any inline SQL statement
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
Example
Here where clause constructed by sqlexp tag is used within the ics:catalogmanager.selectrows tag. This query selects all rows with id=1.
<ics:clearerrno/>
<ics:sqlexp
column="id"
output="whereList"
string="1"
table="ExampleTable"
verb="=" />
<ics:getvar name="whereList"/>
<ics:if condition='<%ics.GetErrno() != 0 %>'>
<ics:then>
Error occurred while constructing where clause
</ics:then>
</ics:if>
<ics:clearerrno/>
<ics:catalogmanager>
<ics:argument name="ftcmd" value="selectrow(s)"/>
<ics:argument name="tablename" value="ExampleTable"/>
<ics:argument name="selwhere" value='<%=ics.GetVar("whereList")%>'/>
<ics:argument name="selwhat" value="id"/>
</ics:catalogmanager>
<ics:if condition='<%ics.GetErrno() != 0 %>'>
<ics:then>
Error occured while selecting rows
</ics:then>
<ics:else>
<ics:getvar name="cshttp"/>
</ics:else>
</ics:if>
See Also