Select the data with '

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • debasisdas
    replied
    That single quote is a night mare for developers. If not handled properly that appears time and again and at times can crash the entire application.

    Leave a comment:


  • docdiesel
    replied
    Hi,

    usually you've got to escape the apostrophe ' with a second one, so use a

    Code:
    select * from PLAN where plan_name = 'A'''
    with three apostrophes after the A. Yes, I know, it looks strange, but it works.

    Regards,

    Bernd

    Leave a comment:


  • swapnam
    started a topic Select the data with '

    Select the data with '

    Hi,

    I have a problem using the select query to retreive the data containing '. I am using Aqua data studio as my DB2 client and my server is DB2 8.1.

    For example,

    select * from PLAN where plan_name = 'A''

    I am selecting for a plan whose plan name is A'. I was able to insert this data using my java code.

    When I am executing this query, I get the following error,

    DB2 SQL error: SQLCODE: -10, SQLSTATE: 42603, SQLERRMC: 'A''
    Message: The string constant beginning with "'A''" does not have an ending string delimiter

    Please help to retreive this data.
Working...