Home » RDBMS Server » Server Administration » Masking special characters in SQLPLUS
Masking special characters in SQLPLUS [message #373822] Mon, 14 May 2001 13:58 Go to next message
S Bala
Messages: 9
Registered: April 2001
Junior Member
Hi,
How will i mask special characters when i input them as
data to the table.eg
SQL>update my_table set my_field= 'here's the field' where my_prim_key ='X';

ERROR i get :
-----------------
ERROR at line 1:
ORA-00933: SQL command not properly ended
------------------
Here i want to insert a single quote(') as a text string into my oracle field .
i also tried a backslash(\) before the qoute ,but it doesn't help.
Please suggest me a solution.
Regards,
S Bala
Re: Masking special characters in SQLPLUS [message #373825 is a reply to message #373822] Mon, 14 May 2001 15:19 Go to previous message
Cindy
Messages: 88
Registered: November 1999
Member
Try this:

VARIABLE g_char VARCHAR2(30)

DECLARE
v_char VARCHAR2(30);

BEGIN
v_char := 'John Due''s book';

:g_char := v_char;
END;
/
PRINT g_char

RESULT:

PL/SQL procedure successfully completed.

G_CHAR
--------------------------------
John Due's book
Previous Topic: DB´s Models...
Next Topic: How to use count function to count insurance policy which more than one person hold?
Goto Forum:
  


Current Time: Mon Dec 23 10:05:20 CST 2024