If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Escape Character in Oracle?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-13-03, 15:09
doofusboy doofusboy is offline
Registered User
 
Join Date: Jul 2003
Posts: 24
Escape Character in Oracle? [RESOLVED]

This is probably a simple noob-type question, but I don't have any SQL/Oracle books with me......what's the escape character in Oracle?

I'm trying to insert a record with a value of 'Sterile Fill (B&S)' but it looks like the ampersand is causing a problem.

Any suggestions appreciated.

Last edited by doofusboy; 10-14-03 at 06:27.
Reply With Quote
  #2 (permalink)  
Old 10-13-03, 15:26
The_Duck The_Duck is offline
Registered User
 
Join Date: Jul 2003
Posts: 2,292
set define off
__________________
- The_Duck
you can lead someone to something but they will never learn anything ...
Reply With Quote
  #3 (permalink)  
Old 10-14-03, 00:13
cyrus cyrus is offline
Registered User
 
Join Date: Oct 2003
Location: Pune
Posts: 59
Escape characters are those which have to be speciallly handled .
comma, double quotes , & are escape characters

cyrus
Reply With Quote
  #4 (permalink)  
Old 10-14-03, 01:12
arvindl arvindl is offline
Registered User
 
Join Date: Oct 2003
Posts: 26
Re: Escape Character in Oracle?

Following is another method using escape on

SQL> show escape define
escape OFF
define "&" (hex 26)
SQL> insert into test values('A & A');
Enter value for a: a
old 1: insert into test values('A & A')
new 1: insert into test values('A a')

1 row created.

SQL> set escape on
SQL> insert into test values('A \& A');

1 row created.
Reply With Quote
  #5 (permalink)  
Old 10-14-03, 06:26
doofusboy doofusboy is offline
Registered User
 
Join Date: Jul 2003
Posts: 24
Thanks The_Duck! That was the quickest easiest solution for me to use. You da fowl!!!!

Also, thanks arvindl for reminding me of the '\' as that's what I was looking for. The 'set define off' just saves me from editing the code.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On