I have the following table:
Example:
create table test
(
id int,
name varchar(10),
city varchar(10)
);
I want to assign ID value from table to variable in the function.
Function:
create or replace function testing(ids int,names varchar(10),citys varchar(10)
returns void as
$body$
Declare
ident int;
BEGIN
ident := SELECT ID FROM test;
raise info '%',ident;
END;
$body$
Language plpgsql;
Error Details:
ERROR: syntax error at or near "SELECT"
LINE 12: ident := SELECT ID from test;