DBMS_OUTPUT.PUT_LINE in postgresql

Below is the example to print the variable value in postgres anonymous block.

DO
 $$
 DECLARE
 t integer;
 BEGIN
 t := nextval(‘DocumentContextIDSEQ’);
 RAISE NOTICE ‘Hello %’,t;
 END;
 $$;
NOTICE:  Hello 13
DO

DO
 $$
 DECLARE
 t integer;
 BEGIN
 select nextval(‘DocumentContextIDSEQ’) into t;
 RAISE NOTICE ‘Hello %’,t;
 END;
 $$;
NOTICE:  Hello 11
DO

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s