Home » SQL & PL/SQL » SQL & PL/SQL » String
String [message #10784] Tue, 17 February 2004 05:19 Go to next message
Scion78
Messages: 15
Registered: February 2004
Junior Member
A very basic question.
I have a string which is like
v_str := ' Hello user's';
Now the apostrophe in the user"'"s is causing the string to terminate. Is there a way to print it out.

Thanks.
Re: String [message #10785 is a reply to message #10784] Tue, 17 February 2004 05:40 Go to previous messageGo to next message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
Double up the single quotes.
SQL> DECLARE
  2      v_str       VARCHAR2(200);
  3  BEGIN
  4      v_str := 'Isn<font color=red><b>''</b></font>t this pretty';
  5      DBMS_OUTPUT.PUT_LINE('v_str = ' || v_str);
  6  END;
  7  /
v_str = Isn<font color=red><b>'</b></font>t this pretty
 
PL/SQL procedure successfully completed.
 
SQL>
I know this is an Oracle forum and not an English grammar/usage forum, but I just wanted to point out that in your own example of "Hello user's", "users" is a plural, not a possessive, and as such, no apostrophe is required.

HTH,

Art.
Re: String [message #10786 is a reply to message #10785] Tue, 17 February 2004 06:10 Go to previous message
Scion78
Messages: 15
Registered: February 2004
Junior Member
Thanx for the oracle help and also the grammatical correction. The actual sentence needed the apostrophe, this was just something i quickly concocted.
Previous Topic: Dynamic string substitution
Next Topic: Dynamic query
Goto Forum:
  


Current Time: Thu Apr 25 06:54:10 CDT 2024