Re: unable to assign value to variable in plpgsql

From: Chirag Mittal <linux(at)seasonstravel(dot)co(dot)in>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: unable to assign value to variable in plpgsql
Date: 2014-02-16 16:51:25
Message-ID: 1392569485780-5792298.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message David Johnston 2014-02-16 16:51:47 Re: unable to assign value to variable in plpgsql
Previous Message David Johnston 2014-02-16 16:34:37 Re: unable to assign value to variable in plpgsql