# 9. SQL Procedure Language Guide

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
SQL Procedure Language Guide
General Principles
Scope of Declarations
Data Types
Handling Result Sets
Result Sets and Array Parameters
Exception Semantics
Virtuoso/PL Syntax
CREATE ASSEMBLY Syntax - External Libraries
CREATE PROCEDURE Syntax - External hosted procedures
Asynchronous Execution and Multithreading in Virtuoso/PL
Performance Tips
Procedures and Transactions
Distributed Transaction & Two Phase Commit
Triggers
Character Escaping
Statement Level Connection Level Server Default
Virtuoso/PL Scrollable Cursors
Virtuoso PL Modules
Handling Conditions In Virtuoso/PL Procedures
Procedure Language Debugger
Row Level Security

## 9.15. Character Escaping

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.

### 9.15.1. Statement 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.)

### 9.15.2. Connection Level

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

### 9.15.3. Server Default

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.

Note

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