db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Portability issue for 'Like-clause' on non-string types ?
Date Fri, 27 Jun 2008 15:17:05 GMT
Rick Hillegas <Richard.Hillegas@Sun.COM> writes:

> Hi Albert,
>
> As Dyre and Donald point out, the LIKE operator can only be applied to
> strings. You can write your own casting function to turn your integers
> into strings (or to extract other information which you may be
> encoding in integers). Something like the following should work:
>
> select * from t
> where intToString( intCol ) like '34%'

We also have a built-in function called CHAR that does this:
http://db.apache.org/derby/docs/dev/ref/rrefbuiltchar.html

-- 
Knut Anders

Mime
View raw message