Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to insert Special Characters ?

RE: How to insert Special Characters ?

From: Bernard, Gilbert <Gilbert.Bernard_at_caissedesdepots.fr>
Date: Wed, 31 Jul 2002 02:33:38 -0800
Message-ID: <F001.004A70F4.20020731023338@fatcity.com>


Try this
Chr(39) || 'bla bla' | chr(39)

Chr(39) = '

	-----Message d'origine-----
	De:	John Thomas [mailto:john_at_toronto.demon.co.uk]
	Date:	mercredi 31 juillet 2002 11:48
	À:	Multiple recipients of list ORACLE-L
	Objet:	Re: How to insert Special Characters ?

	Prakash, 

	Two methods:

	SQL> alter table test modify (c1 varchar2(100));

	Table altered.

	SQL> insert into test values ('where part_no=''1234'' and name =
	''guest''');

	1 row created.

	SQL> select * from test;

	C1
	

------------------------------------------------------------------------
------ where part_no='1234' and name = 'guest' SQL> set define off SQL> show def define OFF SQL> insert into test values ('bla&bla'); 1 row created. SQL> select * from test; C1
------------------------------------------------------------------------
---------------------------- where part_no='1234' and name = 'guest' bla&bla SQL> insert into test values ('the cat sat on the "mat"'); 1 row created. SQL> select * from test; C1
------------------------------------------------------------------------
---------------------------- where part_no='1234' and name = 'guest' bla&bla the cat sat on the "mat" ALTERNATIVE METHOD (Not guaranteed to work cross-platform): SQL> select ascii('&'), ascii('"') from sys.dual SQL> / ASCII('&') ASCII('"') ---------- ---------- 38 34 SQL> insert into test values ('bla' || CHR(38) || 'bla' || CHR(34) || 'bla'); 1 row created. SQL> select * from test; C1
------------------------------------------------------------------------
---------------------------- where part_no='1234' and name = 'guest' bla&bla the cat sat on the "mat" bla&bla"bla SQL> spool off Cheers, John Thomas Contract Oracle Development DBA (currently available for development, development support, performance tuning and other work.) In article <F001.004A6DD2.20020730205823_at_fatcity.com>, guess who <yours_in_at_rediffmail.com> writes >I want to insert the following characters , > >1.) ' > >2.) " > >3.) & > >for example i want to insert the following line as it looks... > > where part_no='1234' and name='guest' > >how to do ? > >can anyone help ... > >Regards, >Prakash. > >-- >Please see the official ORACLE-L FAQ: http://www.orafaq.com -- John Thomas -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: John Thomas INET: john_at_toronto.demon.co.uk Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Bernard, Gilbert
  INET: Gilbert.Bernard_at_caissedesdepots.fr

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jul 31 2002 - 05:33:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US