How do I retrieve last rec in a table?
Date: Wed, 04 Oct 2000 14:52:24 -0500
Message-ID: <39DB8A78.679F8ECD_at_intervoice.com>
[Quoted] [Quoted] This may be a dumb question, but how do you get the last record in a table. I would like to implement this feature in my Dev2K App where the user will hit a button and depending on the datablock hs/she is focused in on, the app will take them to the last record. I figured out
how to get to the first record, but I'm stumped on how to retrieve the last one. This is my code so far that gets me to the last record...
declare
cursor cur_x is
select
service_provider_id,
provider_name
from service_providers
order by service_provider_id;
begin
dbms_output.enable;
for rec_x in cur_x loop
dbms_output.put_line ('service provider id: ' ||
rec_x.service_provider_id);
end loop;
end;
NOTE: I'm using Oracle Server 8.0.5 on Solaris. Developer2K Rel.2.1 Received on Wed Oct 04 2000 - 21:52:24 CEST