Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002
    Posts
    86

    Unanswered: Problem with creation UDF

    Hi All,
    I am working with db2v7.2 Aix.I am trying to create UDF like:

    create function cbtest1 (char(12))
    returns varchar(10) for bit data
    specific cbtest
    external name 'cbudf1!cbtest1'
    language C
    parameter style DB2SQL
    not variant
    fenced
    not null call
    no sql
    no external action
    no scratchpad
    no final call
    DB20000I The SQL command completed successfully.

    when I try use this, I get error:
    db2 "select cbtest(col1) from tab1"
    SQL0440N No function by the name "CBTEST" having compatible arguments was
    found in the function path. SQLSTATE=42884

    Should I do something else after I created UDF? Please help

  2. #2
    Join Date
    Jul 2002
    Posts
    86

    Re: Problem with creation UDF

    Originally posted by David2002
    Hi All,
    I am working with db2v7.2 Aix.I am trying to create UDF like:

    create function cbtest1 (char(12))
    returns varchar(10) for bit data
    specific cbtest
    external name 'cbudf1!cbtest1'
    language C
    parameter style DB2SQL
    not variant
    fenced
    not null call
    no sql
    no external action
    no scratchpad
    no final call
    DB20000I The SQL command completed successfully.

    when I try use this, I get error:
    db2 "select cbtest(col1) from tab1"
    SQL0440N No function by the name "CBTEST" having compatible arguments was
    found in the function path. SQLSTATE=42884

    Should I do something else after I created UDF? Please help
    After I set path like:
    db2 set current function path sysibm, sysfun,dba
    DB20000I The SQL command completed successfully.

    I got this Error
    db2 "select cbtest1(col1) from tab1"

    1
    -----------------------
    SQL0444N Routine "DBA.CBTEST1" (specific name "CBTEST1") is implemented with
    code in library or path "...sqllib/function/cbudf1", function "cbtest1" which
    cannot be accessed. Reason code: "4". SQLSTATE=42724

    I will thankfull if you share you knowledge

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Problem with creation UDF

    The reason code 4 seems to suggest that the library is not present in the directory

    Cheers

    Sathyaram

    Originally posted by David2002
    After I set path like:
    db2 set current function path sysibm, sysfun,dba
    DB20000I The SQL command completed successfully.

    I got this Error
    db2 "select cbtest1(col1) from tab1"

    1
    -----------------------
    SQL0444N Routine "DBA.CBTEST1" (specific name "CBTEST1") is implemented with
    code in library or path "...sqllib/function/cbudf1", function "cbtest1" which
    cannot be accessed. Reason code: "4". SQLSTATE=42724

    I will thankfull if you share you knowledge

  4. #4
    Join Date
    Jul 2002
    Posts
    86

    Re: Problem with creation UDF

    Originally posted by sathyaram_s
    The reason code 4 seems to suggest that the library is not present in the directory

    Cheers

    Sathyaram
    Thank you sathyaram_s

    after I created cbudf1 file in ../sqllib/function I got the same error with RC = 6
    I think I should write C program with .cpp file and then compile it so db2 will create a module in ../sqllib/function . is it right? If it is right, creating a UDF become so complex for me because I do not have C programing experience. please advise

    Thanks

Posting Permissions

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