Q1: Print simple message
do
$$
declare
message varchar(100):='This is my life';
begin
raise notice 'The number of films: %', message;
end;
$$
Output:
NOTICE: The number of films: This is my life
Query returned successfully with no result in 12 msec.
Q 2: Print two message
do
$$
declare
message1 varchar(100):='This is my life';
message2 varchar(100):='I love my life';
begin
raise notice '% %' , message1 , message2;
raise notice 'This is print:- %' , message2;
-- raise notice 'The number of films: %', message;
end;
$$
Delimiters:
1.single line comments
2.multi line comment
do
$$
declare
--single line comment
-- message1 varchar(100):='This is my life';
message2 varchar(100):='I love my India';
begin
--multi line comment
/*
raise notice '% %' , message1 , message2;
raise notice 'This is print:- %' , message2;
-- raise notice 'The number of films: %', message;
*/
end;
$$
No comments:
Post a Comment