Home » Developer & Programmer » Forms » showing query result in tabular form: missing results
showing query result in tabular form: missing results [message #78694] Mon, 11 March 2002 05:34 Go to next message
Xavier
Messages: 11
Registered: March 2002
Junior Member
I have this query:

declare

cursor c1 is
select empno, empname, empsal

from emp;


begin
go_block('emp');

open c1;

loop
if :system.record_status !='NEW' then

create_record;
end if;

fetch c1 into :empno, :empname, :empsal;
exit when c1%notfound;
end loop;

first_record;

end;

What I want to do is display the 5 first results, then when I click on the 'next' button display the 5 next results, and so on till I displayed all results.

the problem is, this script shows the 5 first results, but when I click 'next' it shows then the 5 LAST results.

What can I do to display the results between?

Thx a lot if you can help me
Re: showing query result in tabular form: missing results [message #78695 is a reply to message #78694] Mon, 11 March 2002 06:02 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
create a global variable, which will keep the number of record displayed currently. each time u loop thru the loop increase this.

according to ur current code, if there is 14-record in employee table then first time it will create 14-record and next time 14-record so on..
Re: showing query result in tabular form: missing results [message #78705 is a reply to message #78694] Mon, 11 March 2002 23:32 Go to previous messageGo to next message
Xavier
Messages: 11
Registered: March 2002
Junior Member
I'm not sure to see your point here. how exactly do I use this global variable? where does it intervene in the code? since all rows in a same column represent the same item, how do I differentiate each row?

could you give me an example for the code?

thanks a lot
Re: showing query result in tabular form: missing results [message #78709 is a reply to message #78694] Mon, 11 March 2002 23:57 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
1.populate the block first as u did earlier.
2.set the global_variable to system.cursor_record
3.when next button is pressed, then go to the record
(global_variable+5)th record. and update global_variable to system.cursor_record
and so on

Hope it helps!!!
Previous Topic: populating list item at runtime ,frm-41337
Next Topic: Re: Does Oracle 8i or 8 support SQL* Forms 3.0
Goto Forum:
  


Current Time: Thu Mar 28 05:21:53 CDT 2024