Home » SQL & PL/SQL » SQL & PL/SQL » multipole row return function - this is definitely NOT urgent, so answer me in the next few weeks
multipole row return function - this is definitely NOT urgent, so answer me in the next few weeks [message #242361] Fri, 01 June 2007 12:12 Go to next message
oracleproblem
Messages: 47
Registered: May 2006
Location: Dhaka
Member
sir,
i create a function(package),mainly this function will return multipole row.....
this is my package ......
###################3
create or replace package some_pkg
as
type emp_array is table of emp.sal%type;
end;


create or replace package body some_pkg as
function get_all_emp(v_deptno in emp.deptno%type)
return some_pkg.emp_array
is
l_emp_array some_pkg.emp_array;
begin

select sal
bulk collect into l_emp_array
from emp
where deptno=v_deptno;

return l_emp_array;
end get_all_emp;
end;
#########################
How ever i can see result in sqlplus environment....,run your computer and any suggestion in this package please help me.......urgent..
masud raihan(Dhaka,Bangladesh)

[mod edit - removed all references to the word urgent and important]

[Updated on: Fri, 01 June 2007 12:16] by Moderator

Report message to a moderator

Re: multipole row return function - this is definitely NOT urgent, so answer me in the next few week [message #242366 is a reply to message #242361] Fri, 01 June 2007 12:29 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Reedit after reading and applying How to format your posts
And post your Oracle version (4 decimals).

Edit: you forgot one "urgent" during your previous edit.

Regards
Michel

[Updated on: Fri, 01 June 2007 12:30]

Report message to a moderator

how can i see function result [message #242373 is a reply to message #242361] Fri, 01 June 2007 12:57 Go to previous messageGo to next message
oracleproblem
Messages: 47
Registered: May 2006
Location: Dhaka
Member
Sir,
this is my multipole row return function.how ever i can call this function sqlplus environment and i want to see return result.please give me suggestion.please this package at first run sqlplus then suggest me please...very urgent.if you can know any process or sample of multirow return function then send me.


create or replace package some_pkg
as
type emp_array is table of emp.sal%type;
end;


create or replace package body some_pkg as
function get_all_emp(v_deptno in emp.deptno%type)
return some_pkg.emp_array
is
l_emp_array some_pkg.emp_array;
begin

select sal
bulk collect into l_emp_array
from emp
where deptno=v_deptno;

return l_emp_array;
end get_all_emp;
end;
Re: how can i see function result [message #242377 is a reply to message #242373] Fri, 01 June 2007 13:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't start a new topic with the same question everay 3/4 hour.
Better do what we said you in the original one.

Regards
Michel
Re: multipole row return function - this is definitely NOT urgent, so answer me in the next few week [message #242418 is a reply to message #242366] Fri, 01 June 2007 20:03 Go to previous messageGo to next message
oracleproblem
Messages: 47
Registered: May 2006
Location: Dhaka
Member
i use oracle 9i
Re: multipole row return function - this is definitely NOT urgent, so answer me in the next few week [message #242419 is a reply to message #242361] Fri, 01 June 2007 20:22 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>>And post your Oracle version (4 decimals).
>i use oracle 9i
It appears you can not count to FOUR.
You're On Your Own (YOYO)!
Re: multipole row return function - this is definitely NOT urgent, so answer me in the next few week [message #242420 is a reply to message #242366] Fri, 01 June 2007 20:27 Go to previous messageGo to next message
oracleproblem
Messages: 47
Registered: May 2006
Location: Dhaka
Member
sorry,sir this is my last update,please view it and provide better solution........
############
create or replace package some_pkg
as
type emp_array_type is record
(sal number(7,2));
--emp_record emp_array_type;
end;


create or replace package body some_pkg as
function get_all_emp(v_deptno in emp.deptno%type)
return some_pkg.emp_array_type
is
l_emp_array some_pkg.emp_array_type;
begin

select sal
into l_emp_array
from emp
where deptno=v_deptno;

return l_emp_array;
end get_all_emp;
end;

variable g_sal number
execute :g_sal:=get_all_emp(10);

this is my whole process but a error occur
ERROR at line 1:
ORA-06550: line 1, column 16:
PLS-00905: object SCOTT.GET_ALL_EMP is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

please help me urgent
Re: multipole row return function - this is definitely NOT urgent, so answer me in the next few week [message #242421 is a reply to message #242361] Fri, 01 June 2007 20:38 Go to previous message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>please help me urgent
Please explain why it is urgent for ME to solve this problem for you.
Please read & FOLLOW the posting guidelines as stated in the #1 STICKY post at the top of this forum.

With advice, you can have it good, fast or cheap. Pick any 2.
Previous Topic: Need help w/ cursors
Next Topic: Indexes
Goto Forum:
  


Current Time: Fri Dec 09 13:37:51 CST 2016

Total time taken to generate the page: 0.08390 seconds