sql - Get data from stored procedure in oracle -
this question has answer here:
i have table
create table "tb_job_log" ( "codigo" number, "descripcion" varchar2(200 byte), "fecha" date )
i have stored procedure
create or replace procedure dummy_test( v_mes in number default null, v_anho in number default null, cv_1 in out sys_refcursor) begin open cv_1 select codigo, fecha tb_job_log codigo > 5 , codigo < 10; end dummy_test;
i want results dummy_test other stored procedure
create or replace procedure job_fill_ce cc sys_refcursor; l tb_job_log%rowtype; begin dummy_test(null, null, cc); loop fetch cc l; exit when cc%notfound; dbms_output.put_line(l.codigo); end loop; close cc; end job_fill_ce;
but error when execute job_fill_ce
ora-06504: pl/sql: return types of result set variables or query not match ora-06512: en "job_fill_ce", line 7 ora-06512: en line 2
am missing something?
select codigo, fecha tb_job_log
in cursor selecting 2 columns
and later declaring l of rowtype of tb_job_log contain 3 columns
l tb_job_log%rowtype;
probably because of getting error
please create record type of type codigo, fecha , check
Comments
Post a Comment