plsqldeveloper - Looping through multiple results in PLSQL -
i have select query returns 50 results. select query returns id .
the next part need run select query value 50 ids.
please can 1 tell me best way done. using loop idea e.g.
begin declare @count= select id table1 1 @count ..loop select value table2 id =1 end loop
can use cursors best method.
please elaborate on statement "the next part need run select query value 50 ids." however, if want fetch 50 records in pl/sql block , manipulate them in way, require cursor. records cursor can fetched both , without loop.
cursor example:
declare cursor c1 select col1 table1; begin in c1 loop dbms_output.put_line(a.col1); end loop; end;
the above piece of code display values col1 when server output on.
Comments
Post a Comment