Home » SQL & PL/SQL » SQL & PL/SQL » using multiple "single quotation" (sql developer, ,windows xp)
using multiple "single quotation" [message #283423] Tue, 27 November 2007 02:05 Go to next message
senganga
Messages: 15
Registered: November 2007
Location: South Africa
Junior Member

Please help I have a select statement and mutiple single qiotes (') example
v_rec := 'select A, B 
          from table_x 
          where A = 'Closed' 
             AND B is not null';


The proble is a the quotes (it nolonger inclose "Closed" the second quote is as if it is closing the first one...)

Regards
Re: using multiple "single quotation" [message #283428 is a reply to message #283423] Tue, 27 November 2007 02:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Double the quote inside the string:
''Closed''
.
But if your query does not contains variable part, there is no need to create a dynamic one.

Regards
Michel
icon14.gif  Re: using multiple "single quotation" [message #283434 is a reply to message #283428] Tue, 27 November 2007 02:23 Go to previous messageGo to next message
senganga
Messages: 15
Registered: November 2007
Location: South Africa
Junior Member

Thank you! it solved my problem Smile
Re: using multiple "single quotation" [message #283436 is a reply to message #283423] Tue, 27 November 2007 02:31 Go to previous messageGo to next message
anirudha
Messages: 2
Registered: May 1999
Location: Hyderabad
Junior Member
Please use the below code:
v_rec := 'select A, B
from table_x
where A = ''Closed''
AND B is not null';
Re: using multiple "single quotation" [message #283437 is a reply to message #283436] Tue, 27 November 2007 02:32 Go to previous message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.

Regards
Michel
Previous Topic: Display REFCURSOR results through PL/SQL
Next Topic: Please fine tune my query
Goto Forum:
  


Current Time: Wed Dec 07 05:04:13 CST 2016

Total time taken to generate the page: 0.07089 seconds