SQL STRING DELIMITER field (SQLDELI DECP value)
The SQLDELI DECP value specifies the character that is to be used as the SQL string delimiter to delimit character strings in dynamic SQL.
Acceptable values: | DEFAULT, " (quotation mark), ' (apostrophe) |
---|---|
Default: | DEFAULT |
Update: | not recommended |
dsnhdecp: | SQLDELI |
This option is effective for all varieties of COBOL.
The value in this field also determines which character is the escape character for delimited identifiers in dynamic SQL. If you specify an apostrophe in this field, you get a quotation mark for your SQL escape character. If you specify a quotation mark in this field, you get an apostrophe for your SQL escape character.
For SQL statements that are embedded in COBOL programs, COBOL precompiler options specify which character is the SQL string delimiter and which character is the SQL escape character. If you specify DEFAULT in this field, a quotation mark is passed to the precompiler as the default SQL string delimiter.
Some applications might require a particular value for the SQL STRING DELIMITER. Determine the required values for those applications before installing Db2.
The following table shows the different combinations of character string delimiters that result from specifying different values in the STRING DELIMITER field and the SQL STRING DELIMITER field.
When you want this combination of character string delimiters... | Specify this in STRING DELIMITER field | Specify this in SQL STRING DELIMITER field | ||
---|---|---|---|---|
COBOL | Dynamic SQL | Embedded SQL | ||
" | ' | " | DEFAULT | DEFAULT |
' | ' | ' | ' | ' |
" | " | " | " | " |
" | ' | ' | " | ' |
The values that you specify in the STRING DELIMITER field and the SQL STRING DELIMITER field are also used by the program preparation panels, the DSNH CLIST, and the precompiler. The following table shows why you might specify different combinations of values in these fields.
Purpose | STRING DELIMITER field | SQL STRING DELIMITER field |
---|---|---|
Force APOST default (even in COBOL) and provide a default similar to APOST in Db2 Server for VSE & VM. | ' | ' |
Change dynamic query string delimiter to the quotation mark. This is helpful if you use COBOL with the QUOTE option. It allows queries to be tested with dynamic SQL and moved into the program more easily. | " | " |
Enables compatibility with the Db2 Server for VSE & VM option. | " | ' |