Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    Chennai
    Posts
    1

    UDF problem in Cognos

    Hi all,

    Pls help me in UDF,DB is Oracle.
    I did the following steps but not able to get in Impromtu.

    1)Created this function in DB.

    CREATE OR REPLACE function check_numeric(xvar varchar2) return varchar2 as
    yn varchar2(1) := 'Y';
    nvar number := 0;
    begin
    select xvar/100 into nvar from dual;
    yn := 'Y';
    return yn;
    Exception
    When VALUE_ERROR OR INVALID_NUMBER Then
    yn := 'N';
    return yn;
    end;

    2)Created a file cogudfor.sql(as this file not exist in bin folder) and pasted the following code.

    DECLARE DATABASE FUNCTION check_numeric(STRING)
    RETURNS STRING
    FUNCTION NAME check_numeric;

    3)Changed the impfunct.ini,

    check_numeric= in [Common Database Function List] part and added following script in bottom of the file.

    [check_numeric]
    label=check_numeric
    param=1
    return=CH
    1=CH;text_String_exp
    exp=check_numeric(^1)
    tip=Syntax:check_numeric(xvar)
    tip1=String expression

    4)Changed the orfunct.ini,

    check_numeric= in [Database-specific Function List] part and added following script in bottom of the file.

    [check_numeric]
    label=check_numeric
    param=1
    return=CH
    1=CH;text_String_exp
    exp=check_numeric(^1)
    tip=Syntax:check_numeric(xvar)
    tip1=String expression

    and connection thro native mode.

    pls tell me where i went wrong.


    Thanx,
    Prapagar.

  2. #2
    Join Date
    Aug 2004
    Posts
    2

    UDF Syntax

    Check the exp line

    You wrote:
    exp=check_numeric(^1)

    It should be:
    exp=check_numeric ( ^1 )

    There should be spaces between every word / token (except the parameters ^1 etc)

Posting Permissions

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