Need to convert the %rowtype
of oracle to equivalent in postgresql.
My try:
create table public.test
(
id int,
name varchar(20)
);
insert into test values (1,'A');
insert into test values (2,'B');
insert into test values (3,'C');
Note: I have a variable declare with table %rowtype
using which we are checking multiple different column condition's as shown below in the example. It's not working in postgres.
do
$$
declare pky public.test%rowtype;
begin
if pky.id=1
then
raise info 'id:1';
elsif pky.name = 'B'
then
raise info 'name:B';
else
raise info 'false';
end if;
end;
$$;
pky
is a input parameter of function in actual code.