Oracle SQL Quote Operator

Posted by tagicon_admin | August 17, 2015 | in : SQL

Sometimes we use single quotation mark in our sentence. This quotation mark delimiter is specified by quote operator. So quote(q) operator is used in SQL statements to show single quotation mark. Quote operator is not supported in 9i. This operator will support for 10g or higher.

 

For using the quote (q) operator, We can use single or multi byte delimiter or any of the following character pairs:

–> []
–> {}
–> ()
–> <>

 

Syntax of quote (q) operator:
=====================

q'[text to be quoted]’

 

Example:
======

First of all, I am writing a sentence in SQL statement with single quotation mark and with out quote (q) operator below:

 

After executing the above query, I am getting below error from oracle database.

 

Now, I am writing same sentence again in SQL statement with quote (q) operator below:

Here, I used “Quote (q) Operator” for aliases. Above statement show the below result:

 

We can use any character as single quotation mark delimiter.

Example:
=======

SQL statement:

Answer:

 

SQL statement:

Answer:

 

SQL statement:

Answer:

 

SQL statement:

Answer:

 

Related Posts

Leave a Reply