Home » SQL & PL/SQL » SQL & PL/SQL » ref_cursor error
ref_cursor error [message #247798] Wed, 27 June 2007 04:44 Go to next message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
Hi,

i have created one package.

package spec is as

CREATE OR REPLACE package test_search As

type ref_rec is ref cursor;

function search_fun (proj_id in number,userid in varchar2) return  ref_rec;

end test_search;
/


package body is as:
CREATE OR REPLACE package body test_search  AS

function search_fun ( proj_id in number,userid in varchar2) return  ref_rec

is 

seach_string varchar2(4000);
searcg_id number :=1;
v_final_query varchar2(300);
final_cur ref_rec;

begin 

seach_string := proj_id||'|'||userid;

insert into tmp1 values(searcg_id,seach_string);

v_final_query :='select proj_id,year,empid,'||searcg_id||'from ram_resources where proj_id='||proj_id||' and empid='||userid;

open final_cur for (v_final_query);

return final_cur;

end search_fun;

end test_search;
/



now i want to test my function ...but i am not able


i am trying some thing

begin 
result_cur  test_search.ref_rec;
result_cur := test_search.search_fun(2551,rommeliz);
for rec in (result_cur)
loop
dbms_output.put_line(rec.year);
end loop
end;

error is as:
ora-sql-plsql S72 (S72) Expecting: ( . := ; @


--Yash
Re: ref_cursor error [message #247852 is a reply to message #247798] Wed, 27 June 2007 06:44 Go to previous message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
Thx i got my problem !!
Previous Topic: Problem with date format (literal does not match format string)
Next Topic: Multiple Database. How to access other Database table?
Goto Forum:
  


Current Time: Sat Dec 10 16:34:57 CST 2016

Total time taken to generate the page: 0.10176 seconds