Re: Insert of 'special' (& CR/LF ') char in SQL INSERT

From: Phil Nguyen <philn_at_optigfx.optigfx.com>
Date: 17 Mar 94 18:44:38 GMT
Message-ID: <1884_at_optigfx.optigfx.com>


In article <2m79ev$45h_at_mica.inel.gov> rs6_at_inel.gov (Robert K Smith) writes:
>I have found that to insert a single ' into a field using INSERT
>the ' needs to be doubled to ''. How do you insert a &? Given

				   ^^^^^^^^^^^^^^^^^^^^^^

I assume you have this problem while using Sqlplus to insert a & to a char field. You can use "set scan off" prior to the insert statement.

>that my company is EG&G, and my customers don't like seeing EG+G,
>I'd like to know how this is done. I'd expect this is a simple
>thing, maybe already in a FAQ, but I don't see a FAQ here either.
>
>I am also often asked if it is possible to insert a CR/LF into an

			     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
			     You can use the chr function.  
For example:
	insert into tmp values ('line 1' || chr(10) || 'line 2');

>Oracle CHAR field.
>
>Thanks for your help!! Voice: (208) 526-5801 Fax: (208) 526-8480

Hope this helps.

-- 
===============================================================================
Phil Nguyen		     philn_at_optigfx.com
ALPHAREL/optigraphics Inc.   All opinions expressed here are mine and do not  
San Diego, CA 92121  	     reflect those of my employer.
Received on Thu Mar 17 1994 - 19:44:38 CET

Original text of this message