dbTalk Databases Forums  

Problems with using the like clause

comp.databases.ingres comp.databases.ingres


Discuss Problems with using the like clause in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
colinhay66@hotmail.com
 
Posts: n/a

Default Problems with using the like clause - 09-14-2005 , 09:36 PM






I want to find all rows with a '\n' in a varchar column:

where message_text like '%\n%' does not work as the backslash is not
being interpreted literally.

It does not find 'following error:\n%s.'

using lile '%[\n%' escape '[' does not work as a backslash can not be
escaped:

E_AD1018 Illegal pattern match specified: Illegal ESCAPE sequence.
The ESCAPE char must be followed by one of:
`%' (percent)
`_' (underscore)
`[' (left square bracket)
`]' (right square bracket)
another ESCAPE char.

using like '%\\n%' also doesn't work ...

I'm all out of ideas - Help !


Reply With Quote
  #2  
Old   
Roy Hann
 
Posts: n/a

Default Re: Problems with using the like clause - 09-15-2005 , 05:01 AM






<colinhay66 (AT) hotmail (DOT) com> wrote

Quote:
I want to find all rows with a '\n' in a varchar column:

where message_text like '%\n%' does not work as the backslash is not
being interpreted literally.
You are looking for an ASCII 0x5C followed by ASCII 0x6E right? Not ASCII
0x0A? If so, what you are doing works for me. In Windows and Unix.

Roy




Reply With Quote
  #3  
Old   
Roy Hann
 
Posts: n/a

Default Re: Problems with using the like clause - 09-15-2005 , 05:32 AM




"Roy Hann" <specially (AT) processed (DOT) almost.meat> wrote

Quote:
colinhay66 (AT) hotmail (DOT) com> wrote in message
news:1126751772.656598.75310 (AT) f14g2000cwb (DOT) googlegroups.com...
I want to find all rows with a '\n' in a varchar column:

where message_text like '%\n%' does not work as the backslash is not
being interpreted literally.

You are looking for an ASCII 0x5C followed by ASCII 0x6E right? Not ASCII
0x0A? If so, what you are doing works for me. In Windows and Unix.
Of course, if you DID mean 0x0A, then LIKE x'250A25' should do it for you.

Roy




Reply With Quote
Reply




Thread Tools
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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.