Home > Contents > Index >
ICS.literal
Generates a literal value specific to a column in a table.
Syntax
public String literal(String sTable, String sColumn, String sValue);Parameters
sTable
- The table which contains the column.
sColumn
- The name of the column.
sValue
- The value to be converted to a literal.
Description
Sites works with several underlying DBMSs. Each DBMS requires slightly different treatment of literal values. Call the
literal
method to ensure that you supply a literal value appropriate for your DBMS. Theliteral
method relies on values in several properties (such ascc.stringpicture
andcc.datepicture
) to format literal values properly.The SystemSQL table holds SQL statements; the
literal
method is particularly useful for generating variable values that get substituted into those SQL statements. You invoke these SQL statements in a Java program by calling theCallSQL
method.Example
Suppose you put the following SQL command into a query named
MyQuery
in the SystemSQL table:
SELECT * FROM Names WHERE firstname = Variables.my_literalThe following code calls the
literal
method to generate a literal value that is appropriate for the DBMS:
String Table = "Names"; String Column = "firstname"; String Value = "Ramin"; String my_literal = cs.literal(Table, Column, Value);The value of
my_literal
will be substituted into the SQL command when your code subsequently invokescs.CallSQL
. For example:
cs.SetVar("my_literal", my_literal); IList MyList = cs.CallSQL(MyQuery, listname, -1, true, errstr);Returns
If successful, the method returns a string containing the generated literal. If there is an error, the method returns
null
.See Also
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.