DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Resolving apostrophe in SQL

  1. #1
    Join Date
    Jan 2001
    Location
    St. Louis. MO
    Posts
    151

    Question

    How do you write a sql using a like function and the column uses apostrophe.

    Ex.

    select clnt_name from my_clnt where upper(clnt_name) like upper('St. Vincent's');

  2. #2
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287

    select clnt_name from my_clnt where upper(clnt_name) like upper('St. Vincent''s');

  3. #3
    Join Date
    Jan 2001
    Location
    St. Louis. MO
    Posts
    151
    The query did worked, Do you have any other way of doing that. Let's say I'm an ordinary user and I am querying the database. You don't expect me to put two(2) single quote on the apostrophe...right.

    Thanks,

    Ed

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by edsperez
    Let's say I'm an ordinary user and I am querying the database. You don't expect me to put two(2) single quote on the apostrophe...right.
    If you are an ordinar user and you are querying the database *by typing the queries yourself* (using SQL*Plus or similar tool), *you are expected* to put two single quote on the apostrophe - that's how it works.

    If you are an ordinar user and you are querying the database *by using a canned application*, then your programers are expected to take care of this to make life of application users easier....
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

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


Click Here to Expand Forum to Full Width