Wednesday 4 January 2023

PostgreSQL Cursors || Cursors Available In PostgreSQL || Part 1 Simple C...


Only 3.9% of viewers are subscribing to my channel 😓.
I request you to please give click on Subscribe button.
It really helps me grow 😢.




call simple_cursor();

create or replace procedure simple_cursor()
language plpgsql
as $$
declare
lv_string character varying(200);
rec1 record;
cur1 cursor for 
select actor_id, first_name, last_name as end_name from actor order by actor_id;
begin
open cur1;
loop 
fetch cur1 into rec1;
exit when not found;
lv_string := 'Actor ID: '||rec1.actor_id||', Actor First Name: '||rec1.first_name||', Actor Last Name: '||rec1.end_name;
raise notice '%',lv_string;
end loop;
close cur1;
exception when others then
raise notice 'Something Went Wrong';
end;
$$



Keywords:

postgresql cursors simple cursor cursors available in postgresql,simple cursor,cursors available in postgresql,postgresql cursors,postgresql,cursors,cursor,postgres,pg admin,pg admin 4,postgres pg admin,how to create cursor in posgresql,create cursor in posgresql,create simple cursor,fetch cursor,loop cursor,exit cursor,declare cursor,define cursor,cursor in procedure,cursor in function,knowledge 360,akram sohail,cursors in postgresql,postgresql cursor syntax

No comments:

Post a Comment