Thanks everyone for your help, I did the following and it worked
maz := (SELECT count(*) FROM table WHERE col1 = var1);
EXECUTE 'SELECT count(*) FROM table WHERE col1 = $1'
USING col1 INTO maz;
"in" was a typo and var type along with query was under declare (hope this
is right practice techincaly)
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/unable-to-assign-value-to-variable-in-plpgsql-tp5792281p5792298.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.