Icon QUOTEDSTR

Escapes quotes in a string.

Syntax
QUOTEDSTR(<StringExpression> [USING <CharacterExpression>])
QUOTEDSTR(<StringExpression>[, <CharacterExpression>])

<StringExpression> = 

Type of:

CHARACTER|CHAR
CHARACTER VARYING|VARCHAR
GUID
CHARACTER LARGE OBJECT|CLOB

Returns
Same as input

Usage
The QUOTEDSTR function escapes quotes in a string so that it can be used as a literal constant without causing parsing errors. The default character that is escaped is the single quote ('), but you may also specify a character like the double quote ("), if necessary.

Examples
-- The following script accepts a table
-- name and returns a result set that includes
-- all of the rows in the specified table.

SCRIPT (IN TableName VARCHAR)
BEGIN
   DECLARE ResultCursor CURSOR WITH RETURN FOR ResultStmt;

   IF (COALESCE(TableName,'') <> '') THEN
      PREPARE ResultStmt FROM 'SELECT * FROM '+QUOTEDSTR(TableName USING '"');
      OPEN ResultCursor;
   END IF;
END

SQL 2003 Standard Deviations
This function deviates from the SQL 2003 standard in the following ways:

DeviationDetails
ExtensionThis function is an ElevateDB extension.
Image