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

From Vik Fearing
Subject Re: unable to assign value to variable in plpgsql
Date
Msg-id 5300E21F.1090903@dalibo.com
Whole thread Raw
In response to unable to assign value to variable in plpgsql  (Chirag Mittal <linux@seasonstravel.co.in>)
List pgsql-novice
On 02/16/2014 01:22 PM, 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

View this message in context: unable to assign value to variable in plpgsql
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

SELECT INTO int count(*) FROM table WHERE col1 = val1;

or

int := (SELECT count(*) FROM table WHERE col1 = val1);
-- 
Vik

pgsql-novice by date:

Previous
From: Chirag Mittal
Date:
Subject: unable to assign value to variable in plpgsql
Next
From: Martin Steer
Date:
Subject: Re: unable to assign value to variable in plpgsql