The C style escape character can be used to include special characters inside literals. The backslash character, '\', followed by an octal character code or a special character provides a notation for characters that are normally not typable in a string literal such as tab or crlf. Backslash support can be turned on or off at the statement level, the connection level or server default level.
If you want to activate or deactivate the backslash support in a stored procedure you can use the following two special comments (on a separate line) :
--no_c_escapes+
turns the backslash escaping support off (insert into x values ('c:\test') will result in 'c:\test' in the column
--no_c_escapes-
turns the backslash escaping support on. (same as above will insert 'c:test' in the column.)
The switch SET SQL_NO_CHAR_C_ESCAPE can be set to 'on' or 'off' to respectively turn backslash support on or off for the current connection
There is an ODBC connection attribute that can be set for the same effect in an ODBC connection. SQLGetConnectAttr/SQLSetConnectAttr with option ID of 5002 takes values 0 or 1 to facilitate this
SQL_NO_CHAR_C_ESCAPE=0/1 can be set in the "Client" section of the virtuoso.ini file to set the connection default backslash handling behavior. The default value is 0.
When a 'create procedure' is executed and that mode is "ON" the procedure is stored in such a way that it will preserve the setting for it's text no matter what the current default is.
Previous
Triggers |
Chapter Contents |
Next
Virtuoso/PL Scrollable Cursors |