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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -