Results 1 to 8 of 8
  1. #1
    Join Date
    May 2003
    Posts
    6

    Unanswered: How to search for a ' on Informix

    Hello,

    is there a way to search for a ' ? I tried things like :
    Select ... from ... where ... like '%\'';
    But this doesn't work. Does anyone knows for a way to solve my problem?

    Thanks a lot.

  2. #2
    Join Date
    May 2002
    Location
    Osnabrueck Germany
    Posts
    59
    Hi,
    try this
    select field from table where field matches "se?rch"
    or
    select field from table where field matches "se*ch"
    Juergen Ladwig

  3. #3
    Join Date
    May 2003
    Posts
    6
    Maybe my question was not clear enough. In a table with values :

    id value
    ----------
    01 appel
    02 rose
    03 ch'eese
    04 ru'st
    05 rice

    I would like to find ch'eese and ru'st because they contain the single quote ('). The same problem applies to my search for - in a field.

    I still hope someone can help me or simply tell me that this in totally not possible.

  4. #4
    Join Date
    May 2002
    Location
    Osnabrueck Germany
    Posts
    59
    Hi,
    what about
    select * from table where field matches "*'*"
    Juergen Ladwig

  5. #5
    Join Date
    May 2003
    Posts
    6
    I gave it a trie but matches is not known. So I tried again with
    select * from table where field like "*'*";
    But this also does not work.
    Any idea?

  6. #6
    Join Date
    May 2002
    Location
    Osnabrueck Germany
    Posts
    59
    Hi,
    what kind of sql environment do you use? This works for example under informix dbaccess or informix sql editor.
    Juergen Ladwig

  7. #7
    Join Date
    May 2002
    Location
    Osnabrueck Germany
    Posts
    59
    Hi,
    i tried under dbaccess:

    select * from table where field like "%'%"
    Juergen Ladwig

  8. #8
    Join Date
    May 2003
    Posts
    6

    Thumbs up

    Hello Juergen Ladwig,

    I also tried under dbaccess:

    select * from table where field like "%'%"
    select * from table where field like "%-%"

    and everything works just fine. Thanks a lot for your help !

Posting Permissions

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