Home » Developer & Programmer » Reports & Discoverer » reg--passing parameter to a function from a report
reg--passing parameter to a function from a report [message #229231] Fri, 06 April 2007 02:13 Go to next message
karthi_smarty04
Messages: 19
Registered: January 2007
Location: COIMBATORE
Junior Member
hi experts,
i have developed a report using oracle 9i ids report builder.
table used is
table name :marklist
fields : stu_id number,
stu_rank number.
table name: student_master
fields: stu_id number,
stu_name varchar2(20)

i have to display the student name from student_master table by refering the student id of marklist table.

i have created a function get_name
as
function getname(st_id number) return varchar2 is
st_name varchar2(20);
begin
select stu_name into st_name from student_master
where stu_id=st_id;
end;


in the pl/sql editor of a formula column i have called the function as
function STUDENT_NAMEFormula return Char is
begin
RETURN(get_name(stu_id));
end;



iam getting an error as 'stu_id not declared'. i have pass tha stu_id to the function get_name
please help me out.thanks in advance
Re: reg--passing parameter to a function from a report [message #229294 is a reply to message #229231] Fri, 06 April 2007 09:29 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Use ':' before stu_id while you are calling the function get_name.

Where are you returning the name from the function?
Is it getname or get_name?

In the function definition it is getname. Cross check that.

By
Vamsi
Re: reg--passing parameter to a function from a report [message #229356 is a reply to message #229294] Fri, 06 April 2007 23:06 Go to previous messageGo to next message
karthi_smarty04
Messages: 19
Registered: January 2007
Location: COIMBATORE
Junior Member
thanks,
the function name is getname. i have mistyped it.
i have added a field F_1 in the paper in the paper layout.in the property of the F_1 i gave the source as the formula column.i tried the way wat you have told me. i am getting as 'bibd variable not found.

note: i don't have any runtime parameter in my report. iam just displaying the values in table as such.
Re: reg--passing parameter to a function from a report [message #235813 is a reply to message #229231] Tue, 08 May 2007 01:35 Go to previous message
malakolama
Messages: 16
Registered: May 2007
Location: sri lanka
Junior Member

function getname(st_id number) return varchar2 is
st_name varchar2(20);
begin
select stu_name into st_name from student_master
where stu_id=st_id;
return(st_name);
end;

try that pls
Previous Topic: including bitmap image in postscript format report.
Next Topic: Help in check printing
Goto Forum:
  


Current Time: Tue Nov 26 17:24:40 CST 2024