Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    14

    Red face Unanswered: single quotation marks in the insert statement

    hi,
    How to insert a string with a single quotation marks? e.g.:

    insert into mybook(id,bookname) values(1,'William's story');

    This statement will create an error message.

    thanks a lot!

  2. #2
    Join Date
    Nov 2005
    Posts
    17
    Two ways:

    Use two single quotes

    Code:
     insert into mybook(id,bookname) values(1,'William''s story');
    Or specify a user-defined quote character

    Code:
     insert into mybook(id,bookname) values(1,Q'"William's story"');
    The first method is more traditional; however, they both work.

Posting Permissions

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