0

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.

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.