Reputation: 333
Below syntax I have used.
declare
v_data emp_tab ;
BEGIN
select * into v_data from emp_tab where emp_id= 121 limit 1;
raise notice 'Value: %', v_data.emp_info;
END;
which is throwing an error. "syntax error at or near emp_tab" Kindly help.
Upvotes: 0
Views: 56
Reputation: 42763
Try this:
do $$
declare
v_data emp_tab ;
BEGIN
select * into v_data from emp_tab where emp_id= 121 limit 1;
raise notice 'Value: %', v_data.emp_info;
END;
$$ language plpgsql
Upvotes: 1