Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    bozeman, mt
    Posts
    2

    Unanswered: writing single quote to a table

    I am using java to write information to our DB2 7.2.3 on Windows. I am trying to figure out how to write a single quote to the database. I tried using \' and some other things but I haven't figured anything out yet. Can someone tell me what you have to do to write a single quote to the db. Are there any other special chars you have to worry about?
    Thanks.

  2. #2
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513

    Re: writing single quote to a table

    Originally posted by letitsnow
    I am using java to write information to our DB2 7.2.3 on Windows. I am trying to figure out how to write a single quote to the database. I tried using \' and some other things but I haven't figured anything out yet. Can someone tell me what you have to do to write a single quote to the db. Are there any other special chars you have to worry about?
    Thanks.
    It's '' - two single quotes, ie:

    insert into a values ('jon''s quote example')
    --
    Jonathan Petruk
    DB2 Database Consultant

  3. #3
    Join Date
    Mar 2004
    Location
    bozeman, mt
    Posts
    2
    Thank you very much!

Posting Permissions

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