Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Explicit Cursor to fetch the first row

947663Mar 31 2023

Dear Experts,

Currently I am doing as below to get the first row of a cursor. Please guide me if this will break after sometime or not.

declare
cursor c_get_info is
select person_id from per_all_people_f
order by person_id desc;

l_person_id number; ---Not a cursor Row type variable
begin
open c_get_info;
fetch c_get_info into l_person_id;
close c_get_info;

dbms_output.put_line('Person_id:'||l_person_id);
end;

Comments
Post Details
Added on Mar 31 2023
4 comments
474 views