sql - Need help to review PostgreSQL query -


i have following sql query want use postgres

declare      _sql varchar varying(50);     _whereclause varchar varying(50); _whereclause:='and 1=1'  execute 'select count(*) test t 1=1' || _whereclause  

when i'm trying execute above query gives error @ varchar in second line. , time simple command below

declare _sql varchar varying(50); 

it gives error, don't know what's wrong code. have tried figure out postgres sql offcial site , when tried copy , run example given on there it's not executing.

i'm new postgres , i'm feeling unlucky postgres sql syntax.

the syntax incorrect, should use either varchar(50) or character varying(50), not varchar varying(50). eg.

declare     _sql varchar(50);     _whereclause varchar(50); 

Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -