In some cases, the values the client application sends to the RSP contain quotation mark characters, either single or double. Because these characters are frequently used as string delimiters, DirectConnect can misinterpret strings containing quotes. Therefore, it may transform the values in ways that the RSP does not expect, for example by replacing the carriage return-linefeed sequence (CR/LF) with spaces.
To provide maximum control over quote handling in USE statements, Sybase implemented the following rules:
These rules apply only if your setting is TSQL1 or PASSTHROUGH.
The first non-white-space character following the procedure or request name is tested by MainframeConnect for the possibility that it is a special delimiter. Special delimiters can be used to enclose the entire set of argument strings sent to the request or RSP. If the argument string is enclosed by such delimiters, then the characters between the delimiters (including the delimiters themselves) are not modified in any way. In other words, quote processing, uppercasing and so on, is not performed by MainframeConnect.
DirectConnect recognizes a character as a delimiter if it is a member of the following set of characters:
! % ( ) * / : << >> ? \ ' { } | ~
The same delimiter character must be used at both ends
of the string: for example, (xxxxxxxx( or {xxxxxxxx{ (not (xxxxxxxx) ).
If the first non-white-space character is not a delimiter, then MainframeConnect handles quotes according to the following standard TSQL1 rules:
It passes doubled occurrences of either quote character—that is, '' or ""—without modification.
It assumes the first single occurrence of either quote character is a delimiter beginning a quoted string, and it assumes the next single occurrence of the same character ends the quoted string.
It compares the delimiter to the setting in the DirectConnect configuration (.cfg) file, and converts the delimiter if required; that is, double quotes may be converted to single quotes.
It passes occurrences of the other quote characters (that is, double quotes occurring in a string delimited by single quotes or single quotes occurring in a string delimited by double quotes) without modification.