If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > UDF problem in Cognos

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-04-03, 07:07
Prapagar Prapagar is offline
Registered User
 
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.
Reply With Quote
  #2 (permalink)  
Old 08-04-04, 06:15
highandstoned highandstoned is offline
Registered User
 
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)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On