Initializing variables from SQL query - Mailing list pgsql-general

From jc_mich
Subject Initializing variables from SQL query
Date
Msg-id 22612191.post@talk.nabble.com
Whole thread Raw
Responses Re: Initializing variables from SQL query
List pgsql-general
Hi all

I'm new in PL/PGSQL developing, I'm trying to initialize a variable from a
SQL query, this query counts some rows, I've made the next code, but it
doesn't work.

CREATE FUNCTION schema.myFunction() RETURNS BOOLEAN AS $$
DECLARE
    counter RECORD;
BEGIN
    SELECT * INTO STRICT counter FROM (SELECT COUNT (DISTINCT (rows)) FROM
schema.table);

I'm pretty annoyed, because I've found some examples that use this kind of
variable initialization.

Is there someone who know what I did wrong?

Thanks!

--
View this message in context: http://www.nabble.com/Initializing-variables-from-SQL-query-tp22612191p22612191.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: PostgreSQL versus MySQL for GPS Data
Next
From: Adrian Klaver
Date:
Subject: Re: Initializing variables from SQL query