Results 1 to 4 of 4

Thread: Varchar

  1. #1
    Join Date
    Oct 2003
    Posts
    83

    Unanswered: Varchar

    In a varchar parameter of a Stored Procedure how can I pass single quote(')?
    Means I want to pass like 'x'y' in that field (and it is giving error).
    Is it possible?

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Quote Originally Posted by subhasishray
    In a varchar parameter of a Stored Procedure how can I pass single quote(')?
    Means I want to pass like 'x'y' in that field (and it is giving error).
    Is it possible?

    Replace the single quote by two single quotes like 'x''y'.

  3. #3
    Join Date
    Oct 2003
    Posts
    83

    not working

    It is not like replacing single quote with double quotes(like x''y).This stored procedure will be used in a front end and in a text box the input value will be supplied.If the name is x'y it will be supplied as x'y and front end people are saying this can not be trapped from front end it has to be trapped from the back end.That is why I am asking and this is my problem.Can it be solved from the back end?

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I think you are using the double quote (") instead of two apostrophes (''). SQL wants two apostrophe's back-to-back to represent a single apostrophe in the constant.

    -PatP

Posting Permissions

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