Re: unable to assign value to variable in plpgsql - Mailing list pgsql-novice

From Martin Steer
Subject Re: unable to assign value to variable in plpgsql
Date
Msg-id 20140216162409.GA825@arch
Whole thread Raw
In response to unable to assign value to variable in plpgsql  (Chirag Mittal <linux@seasonstravel.co.in>)
Responses Re: unable to assign value to variable in plpgsql
List pgsql-novice
On Sun, Feb 16, 2014 at 04:22:28AM -0800, Chirag Mittal wrote:
>Hi, I am trying to assign number of row as integer Tried 1 maz int :=(SELECT
>count(col1) FROM table WHERE col1 = quote_literal(in val1)); Tried 2 EXECUTE
>'SELECT count(col1) FROM table WHERE col1 = quote_literal(val1) INTO maz';
>getting error INTO Regards Chirag

select count(*)
into maz
from tablename
where col1 = 'val1';

maz int := count(*) from tablename where col1 = 'val1';

M.




pgsql-novice by date:

Previous
From: Vik Fearing
Date:
Subject: Re: unable to assign value to variable in plpgsql
Next
From: David Johnston
Date:
Subject: Re: unable to assign value to variable in plpgsql