Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display in multi-record block with cursors

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm extracting multiple rows using a cursor and would like to display the results in a multi-record block (tabular) on a form. My code below will extract all the rows into the cursor, but the loop displays every row one at a time only on the first row in the multi-record block. This is done so fast that I only see the last row retrieved.

DECLARE
CURSOR MYCUR IS SELECT EID,ENAME,EADDRESS FROM EMPLOYEE;

BEGIN
OPEN MYCUR;
LOOP
FETCH MYCUR INTO :TEST.EID, :TEST.ENAME, :TEST.EADDRESS;
EXIT WHEN MYCUR%NOTFOUND;
END LOOP;
CLOSE MYCUR;

END;
 
Add next_record within your loop or to be more precise add

if :system.record_status<>'NEW' then
next_record;
end if;

before making assignment (fetch).

Bat as I can see your cursor is simple enough to do not use explicit cursor at all: you may base your block on table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top