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

Thread: using an Apsotrophe in a string-HOW?

  1. #1
    Join Date
    Oct 2000
    Posts
    26
    I want to use SQL to enter a string into a field.

    the string is BOB'S

    now how do i do this?

    if i say
    INSERT INTO TABLE (STRING_COLUMN)
    VALUES( 'BOB'S');

    It doesn't work.

    Any ideas?

    TIA,

    JOHN

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    INSERT INTO TABLE (STRING_COLUMN)
    VALUES( 'BOB''S');

    Jeff Hunter

  3. #3
    Join Date
    Nov 2000
    Posts
    344
    If the quote is to be at the end of the string then use 3 :

    string_var := 'It is 'Bobs''';

    this also works at the beginning of a string as in :

    string_var := 'It is Bob' || '''s';

    If you just need an apostrophe all by itself then use 4 :

    string_var := 'It is Bobs' || '''';




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