Professional Web Applications Themes

can't find UDF (42884) - IBM DB2

Hello, I have created a function addWeeks that adds an integer number of weeks to a given Date and returns a Date. I compiled and linked the function using the batch file included in the DB2 samples/c folder. For some reason, even though it says that it is copying the dll succesfully, no dll appears in my sqllib/doc/Function folder. (I don't seem to have a sqllib/functions folder - only the one with "docs" in the middle...) I copied the dll into this folder by hand and then registered the function (using Create Function) with DB2. My create function statement as ...

  1. #1

    Default can't find UDF (42884)

    Hello,
    I have created a function addWeeks that adds an integer number of
    weeks to a given Date and returns a Date. I compiled and linked the
    function using the batch file included in the DB2 samples/c folder.
    For some reason, even though it says that it is copying the dll
    succesfully, no dll appears in my sqllib/doc/Function folder. (I
    don't seem to have a sqllib/functions folder - only the one with
    "docs" in the middle...) I copied the dll into this folder by hand and
    then registered the function (using Create Function) with DB2. My
    create function statement as well as my actual c function definition
    are below. For some reason when I attempt to test the function by
    typing Values(addWeeks('1998-12-25',5)); at the command prompt, I
    receive the following error: "SQL0440N No authorized routine named
    "ADDWEEKS" of TYPE "FUNCTION " having compatible arguments was
    found. The SQLcode is -440 and the SQLstate is 42884. Any ideas?

    code:
    CREATE FUNCTION addWeeks(Date, Integer) RETURNS Date EXTERNAL NAME
    'dateFunctions!addWeeks' DETERMINISTIC NO EXTERNAL ACTION NULL CALL
    LANGUAGE C PARAMETER STYLE DB2SQL NO SQL;

    void SQL_API_FN addWeeks (
    char *dateIn,
    long *weeksIn,
    char *dateOut,
    short *nulldateIn,
    short *nullweeksIn,
    short *nulldateOut,
    char *sqlstate,
    char *fnName,
    char *specificName,
    char *message
    )
    {
    //function body
    }
    Meg Guest

  2. #2

    Default Re: can't find UDF (42884)

    You may want to cast the date-string to a date before passing it to the
    function.
    -440 errors come from the compiler. They are orthogonal to DB2 finding the
    actual DLL at runtime.

    Cheers
    Serge



    Serge Rielau Guest

  3. #3

    Default Re: can't find UDF (42884)

    Meg <glowworm13> wrote:
    > Follow up note: i've reinstalled DB2 and the funtion directory now
    > appears but I am still getting the same error....(even when the dll is
    > copied into the sqllib/function folder.) I have also tried accessing
    > the function with the schema.function-name format...
    Have you followed Serge's advice to cast the string that represents a date
    to the date data type?

    VALUES addWeeks(DATE('1998-12-25'), 5));

    --
    Knut Stolze
    Information Integration
    IBM Germany / University of Jena
    Knut Stolze Guest

Similar Threads

  1. Using DW find to find tags not on page
    By ian@uaa in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: August 9th, 05:13 PM
  2. Find - not?
    By Hoopie in forum Macromedia ColdFusion
    Replies: 1
    Last Post: March 19th, 07:16 AM
  3. trailing slash issue in Find.find
    By Jeff Mitchell in forum Ruby
    Replies: 0
    Last Post: August 23rd, 11:30 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139