If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Like predicate problems

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-10-05, 15:52
skumbhan skumbhan is offline
Registered User
 
Join Date: Sep 2005
Posts: 9
Like predicate problems

Hi:

I am trying to run a simple sql query with a like clause but it fails. The query is as listed below:

select * from sam.change where start_date like '1%'

the query fails with the following error:

select * from sam.change where start_date like '1%'
SQL0440N No authorized routine named "LIKE" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884

Can someone help here.... asap

thanks

samit
Reply With Quote
  #2 (permalink)  
Old 10-10-05, 16:34
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Like only works with strings. I am certain that start_date is DATE.

Andy
Reply With Quote
  #3 (permalink)  
Old 10-11-05, 11:57
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
like

if this is the case : try char(start_date) like '1%'
or use date function : year.... and between
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
Reply With Quote
  #4 (permalink)  
Old 10-11-05, 12:43
skumbhan skumbhan is offline
Registered User
 
Join Date: Sep 2005
Posts: 9
thanks

Yes i tried working on it yesterday and came up with the solution to use

char (column_name) like '2%'

Thanks.

Samit
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

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