Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    Maryland
    Posts
    152

    Unhappy Unanswered: Single Comma in SQL Statement

    I am trying to insert record with a sql statement. One of the variable is having single quot in it(e.g. Thisn't case). It is giving me error because of single comman in value. How can I handle this. To keep it mandatory.

    Any help will be highly appreciated.
    mr_roomi

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I am not sure. I deal with mostly with financials these days but I vaguely remember using the parameters collection in an ADO command object to get around this. Let me know if that works. I am curious.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Jul 2001
    Location
    NC
    Posts
    102
    You didn't indicate what SQL you are using. Some SQL languages have you put a single quote (') in front of the existing single quote, so you have TWO single quotes ... for example 'this isn''t an integer'. Others, such as mySQL, have you place a backward slash (\) in front of the existing single quote... for example 'this isn\'t an integer'.

  4. #4
    Join Date
    Mar 2004
    Location
    Maryland
    Posts
    152

    Database

    I am using Oracle and SQL Server at the same time for data manipulation. Data is coming random and some time it contains single comma. I hope I clear my question.

    Thanks for prompt response.
    mr_roomi

Posting Permissions

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