sql_xlate

Converts statement using the function mapping specified in the sql_xlate_file, which is defined in trim/dv.ini.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

string sql_xlate(statement [,did])
string     statement
int        did

Description

Returns the translated string.
statementspecifies the SQL statement to translate.
did(optional) specifies the target database (as defined in trim.h) so the function can take into account specific database characteristics, such as case-sensitivity. Specifying (-1) means do only the bind variable replacement without translating the SQL syntax.

Notes

You must put the function mapping strings you intend to use in the file specified by sql_xlate_file. For more information about SQL syntax mapping, refer to the DesignVision Users Guide.

Example

The following example converts from Oracle to DB2 syntax. sql_xlate_file points to a valid function mapping file.
{
...
db2sql = sql_xlate("select decode (id,42,16,23) from staff",db_db2);
...
}