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 > SQL0440N No authorized routine named "ADD_MONTHS" of type "FUNCTION

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-07-08, 09:18
smita9990 smita9990 is offline
Registered User
 
Join Date: Oct 2008
Posts: 2
SQL0440N No authorized routine named "ADD_MONTHS" of type "FUNCTION

Hi,

Can someone plz point out what i shd do to get all the results for the following condition

all schools whose from_date is 12 months before 2001-09-04
all schools whose to_date is 12 months after '2001-09-04

I am getting SQL0440N No authorized routine named "ADD_MONTHS" of type "FUNCTION
using db2 ver 8



SELECT
M.SCHOOL_CODE,
M.SCHOOL_NAME

FROM
SCHOOL_MASTER M , SCH_ACCRED A
WHERE
M.SCHOOL_CODE = A.SCHOOL_CD
AND A.FROM_DT = ADD_MONTHS(TO_DATE('2001-09-04 00:00:00', 'YYYY-MM-DD HH24:MIS'), -11)
AND A.TO_DT = ADD_MONTHS(TO_DATE('2001-09-04 00:00:00', 'YYYY-MM-DD HH24:MIS'), 11);
Reply With Quote
  #2 (permalink)  
Old 10-07-08, 10:36
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
ADD_MONTHS is not suppoted on DB2 for LUW Version 8.
Please see:
Fun with Dates and Times
http://www.ibm.com/developerworks/db.../0211yip3.html
Reply With Quote
  #3 (permalink)  
Old 10-07-08, 10:38
smita9990 smita9990 is offline
Registered User
 
Join Date: Oct 2008
Posts: 2
can you plz suggest a work around for this?

thanks
smita
Reply With Quote
  #4 (permalink)  
Old 10-08-08, 02:04
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
to_date are oracle functions and db2 does not need that
you can use date/time function to extract date or time from timestamp
month/day to extract months
or use months/days... to calculate with months
see infocenter for detailed syntax
http://publib.boulder.ibm.com/infoce...c/r0000789.htm
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
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