plpgsql - syntax error when running postgresql function/stored procedure -
trying perform set of complex postgresql db operations using function, simple function gets me error:
error: syntax error @ or near "text" line 3: tmp text := info; ^
here sql
create or replace function createme (info text) returns text $$ declare tmp text := info; begin select :tmp end $$ language sql;
any idea why? thx!
you procedure not in sql language, in plpgsql language.
create or replace function createme (info text) returns text $$ declare tmp text := info; begin return tmp; end $$ language plpgsql;
select :tmp
nonsense in content. functions returns value command return
- similar other environments.
Comments
Post a Comment