Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2008
    Posts
    2

    Unanswered: 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);

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    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

  3. #3
    Join Date
    Oct 2008
    Posts
    2
    can you plz suggest a work around for this?

    thanks
    smita

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •