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
Karma: 0
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: 65153
Registered: March 2007
Location: Nanterre, France, http://...
Karma: 0
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
Karma: 0
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
Karma: 0
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: 65153
Registered: March 2007
Location: Nanterre, France, http://...
Karma: 0
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: sqlca.sqlcode when oracle goes off
Next Topic: qry help plz ... (merged similar topics by same user)
Goto Forum:
  


Current Time: Tue Aug 22 10:06:28 CDT 2017

Total time taken to generate the page: 0.09517 seconds