Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Posts
    5

    Unanswered: issue in invoking UDF from db2 procedure

    I am getting below error with right arguments

    "No authorized routine named "SRCHYRORMNTH" of type "FUNCTION" having compatible arguments was found"

    The invoking statemnet looks like

    SELECT name,,,, from tablename
    WHERE ABS.SRCHYRORMNTH('Y','L',1324485520) = 2010


    The function looks like

    CREATE FUNCTION "ABS"."SRCHYRORMNTH" (v_Type CHAR(1),
    v_DateType CHAR(1),
    v_LONGVAL INTEGER )
    RETURNS INTEGER
    LANGUAGE SQL

    BEGIN ATOMIC

    DECLARE v_DAYOFLONGVAL INTEGER;

    DECLARE v_YearMonth INTEGER;

    // function logic

    RETURN v_YearMonth;

    END

    Please let me know if i am missing something.

    Any help would be appreciated!!
    Jash

  2. #2
    Join Date
    Dec 2010
    Posts
    3

    issue in invoking UDF from db2 procedure

    While you are calling the function in the select statement, explicitly typecast the data.

    SELECT name,,,, from tablename
    WHERE ABS.SRCHYRORMNTH(char('Y'),char('L'),int(132448552 0)) = 2010

  3. #3
    Join Date
    Mar 2009
    Posts
    5

    issue in invoking UDF from db2 stored procedure

    Hi,

    Thank you for the reply!!

    I did found and tried the casting in another way as below

    SELECT name,,,, from tablename
    WHERE ABS.SRCHYRORMNTH(CAST('Y') as CHAR, CAST('L') as CHAR,CAST(1324485520) as INT) = 2010

    Thanks again for your reply and time!!
    jash

Posting Permissions

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