Oracle: Cursor in a Procedure -


please me oracle procedure question. in package have procedure , want declare cursor uses dynamic queries.

type doclist ref cursor; curdoclist doclist; . . . open curdoclist v_sql;   --v_sql has dynamic sql ... recdocstatuslist in curdoclist        loop 

when trying use - recdocstatuslist in curdoclist giving me error: [error] pls-00221 (2262: 34): pls-00221: 'curdoclist' not procedure or undefined.

please me correcting issue.

if you're willing iterate cursor, can perform without using loop.

option 1:

  loop     fetch curdoclist recdocstatuslist;     exit when curdoclist%notfound;     ...   end loop; 

option 2:

fetch curdoclist recdocstatuslist; while (curdoclist%found) loop     ...     fetch curdoclist recdocstatuslist; end loop; 

a few annotations:

  • remember declare recdocstatuslist @ first.
  • both options following open ... line.
  • don't forget close cursor @ end.

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -