Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Posts
    24

    Unanswered: 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 07:27.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    set define off
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    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

  4. #4
    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.

  5. #5
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •