Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Informix > How to search for a ' on Informix

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-05-03, 11:18
mmtw816 mmtw816 is offline
Registered User
 
Join Date: May 2003
Posts: 6
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.
Reply With Quote
  #2 (permalink)  
Old 05-06-03, 02:35
ladwig ladwig is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 05-06-03, 04:35
mmtw816 mmtw816 is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 05-06-03, 04:47
ladwig ladwig is offline
Registered User
 
Join Date: May 2002
Location: Osnabrueck Germany
Posts: 59
Hi,
what about
select * from table where field matches "*'*"
__________________
Juergen Ladwig
Reply With Quote
  #5 (permalink)  
Old 05-06-03, 09:04
mmtw816 mmtw816 is offline
Registered User
 
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?
Reply With Quote
  #6 (permalink)  
Old 05-06-03, 09:14
ladwig ladwig is offline
Registered User
 
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
Reply With Quote
  #7 (permalink)  
Old 05-06-03, 09:19
ladwig ladwig is offline
Registered User
 
Join Date: May 2002
Location: Osnabrueck Germany
Posts: 59
Hi,
i tried under dbaccess:

select * from table where field like "%'%"
__________________
Juergen Ladwig
Reply With Quote
  #8 (permalink)  
Old 05-07-03, 05:20
mmtw816 mmtw816 is offline
Registered User
 
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 !
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On