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 > DB2 Error for LIKE statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-04, 19:16
chris58950 chris58950 is offline
Registered User
 
Join Date: Mar 2004
Posts: 5
DB2 Error for LIKE statement

I'm trying to run this query that I built with the query analyzer. For some reason it doesn't work. Can someone help me with this? Thanks

Chris

sun211d2r(fnsw)/fnsw/stress/indexora> less db2_q12.sql.net
SELECT DOCTABA.F_DOCNUMBER
FROM F_SW.DOCTABA AS DOCTABA
WHERE DOCTABA.A33 LIKE '3.0.0%'
ORDER BY DOCTABA.F_DOCNUMBER ASC;


sun211d2r(fnsw)/fnsw/stress/indexora> db2 -tvf chris.sql
SELECT DOCTABA.F_DOCNUMBER FROM F_SW.DOCTABA AS DOCTABA WHERE DOCTABA.A33 LIKE '3.0.0%' ORDER BY DOCTABA.F_DOCNUMBER ASC
SQL0440N No authorized routine named "LIKE" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884
Reply With Quote
  #2 (permalink)  
Old 04-06-04, 19:20
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
What is the data type for A33?
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 04-06-04, 19:32
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Actually I think you are using the table function (AS) incorrectly, even when it is not needed. Try this:

SELECT F_DOCNUMBER
FROM F_SW.DOCTABA
WHERE A33 LIKE '3.0.0%'
ORDER BY F_DOCNUMBER ASC;
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 04-06-04, 19:39
chris58950 chris58950 is offline
Registered User
 
Join Date: Mar 2004
Posts: 5
Quote:
Originally posted by Marcus_A
What is the data type for A33?

A33 happens to be a VARCHAR datatype.
Reply With Quote
  #5 (permalink)  
Old 04-06-04, 21:29
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally posted by chris58950
SELECT DOCTABA.F_DOCNUMBER
FROM F_SW.DOCTABA AS DOCTABA
WHERE DOCTABA.A33 LIKE '3.0.0%'
ORDER BY DOCTABA.F_DOCNUMBER ASC;

A33 happens to be a VARCHAR datatype.
I vaguely remember something about the single quote being a problem if it's the last character in a line... Can you try rearranging your statement in the script file, something like:

SELECT DOCTABA.F_DOCNUMBER
FROM F_SW.DOCTABA AS DOCTABA
WHERE DOCTABA.A33 LIKE '3.0.0%' ORDER BY
DOCTABA.F_DOCNUMBER ASC;
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