Home » Developer & Programmer » Reports & Discoverer » problem in using functions in the report builder program unit (report builder 6i)
problem in using functions in the report builder program unit [message #480804] Wed, 27 October 2010 06:06 Go to next message
emadnabil
Messages: 177
Registered: August 2007
Senior Member
hii all

I have a confusing problem i want to understand it

i am creating a report using a function in the select query

suppose this is my function that i created in the program unit of the report

FUNCTION is_numeric_rep (p_strval in varchar2) RETURN
NUMBER
 IS
   l_numval NUMBER;
 BEGIN
   l_numval := TO_NUMBER(p_strval);
   RETURN 1;
 EXCEPTION
   WHEN OTHERS THEN
     RETURN 0;
END is_numeric_rep;



and also suppose this is the query of the report
Select 
is_numeric_rep('343aa43')
From dual


when pressing ok on the query statment in the report
it give me this error
ORA-00904 "is_numeric_rep":invalid identifier


although when i create this function as a stored function in the database schema and use it in the report it works fine with no problems

please reply
thanks
Re: problem in using functions in the report builder program unit [message #480807 is a reply to message #480804] Wed, 27 October 2010 06:24 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You can't use a function in report's query (because query runs in the database and there's no way it can see a function that exists in a report). As you already discovered a workaround (which is a stored function) - use it.
Previous Topic: User Exist Concept
Next Topic: How to call oracle reports inside a stored procedure.
Goto Forum:
  


Current Time: Thu Apr 25 23:12:28 CDT 2024