DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Quotes in a SQL Statement

  1. #1
    Join Date
    Dec 2006
    Posts
    11

    Quotes in a SQL Statement

    I am trying to run the below statement so I can include the quotes and I am getting an invalid column name message. I tried the script without using quotes and it works fine. What am I missing?

    update deltek.empl set cont_name_1 = "BARBARA O'BRIEN" where empl_id = '081575';

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Cool


    You need to use two single quotes:

    Code:
    update deltek.empl 
         set cont_name_1 = 'BARBARA O''BRIEN'
     where empl_id = '081575';

    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  3. #3
    Join Date
    Dec 2006
    Posts
    11
    Perfect! Thank you VERY much.

  4. #4
    Join Date
    Jun 2005
    Location
    London, UK
    Posts
    159
    Or in 10g:

    Code:
    UPDATE deltek.empl
    SET    cont_name_1 = q'|Barbara O'Brien|'
    WHERE  empl_id = '081575';
    download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements003.htm

Posting Permissions

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


Click Here to Expand Forum to Full Width