oracle - Trying to understand how pl sql stored proc work and why my results differ -


i have simple stored proc...

create or replace  procedure get_person (aname varchar2, p_data out sys_refcursor) begin    open p_data select * people_table firstname = aname; end; 

however when execute stored proc returns of records.

declare    v_cur sys_refcursor;   v_1   number;   v_2   varchar2(50);   v_3   varchar2(200);   v_4   varchar2(50);   v_5   varchar2(50);   v_6   varchar2(50); begin   get_person ('aaa@bbb.com', v_cur);    loop     fetch v_cur v_1, v_2, v_3, v_4, v_5, v_6;     exit when v_cur%notfound;     dbms_output.put_line(v_2 || ' ' || v_3);   end loop;   close v_cur; end; 

if run simple statement

select * people_table firstname = 'aaa@bbb.com'; 

it correctly returns 1 record.

why stored proc not behaving same?

i found issue..

my issue name collision. when altered code above when noticed issue. has fistname = firstname. once changed parameter p_firstname well.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -