Re: SELECT EXTRACT doesn't work with variables? - Mailing list pgsql-general

From Conxita Marín
Subject Re: SELECT EXTRACT doesn't work with variables?
Date
Msg-id 001b01c2a72f$7fe7e2c0$0cd8a8c0@dims
Whole thread Raw
In response to SELECT EXTRACT doesn't work with variables?  (Conxita Marín <comarin@telefonica.net>)
List pgsql-general
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: miércoles, 18 de diciembre de 2002 17:00
To: Masaru Sugawara
Cc: cmarin@dims.com; pgsql-general@postgresql.org
Subject: Re: [GENERAL] SELECT EXTRACT doesn't work with variables?


Masaru Sugawara <rk73@sea.plala.or.jp> writes:
> Conxita Marín <comarin@telefonica.net> wrote:
>>             aux2 = SELECT EXTRACT(EPOCH FROM TIMESTAMP aux);


> Instead of this line, I think you need to execute the following statement:

>              SELECT INTO aux2 EXTRACT(EPOCH FROM aux);

Or

               aux2 = EXTRACT(EPOCH FROM TIMESTAMP aux);


This works: SELECT INTO aux2 EXTRACT(EPOCH FROM aux);

This doesn't work: aux2 = EXTRACT(EPOCH FROM TIMESTAMP aux);

    NOTICE:  Error occurred while executing PL/pgSQL function prova
    NOTICE:  line 9 at assignment
    ERROR:  parser: parse error at or near "$1"

Thanks to all.

Conxita.





pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: FOSDEM article
Next
From: "帅猛"
Date:
Subject: argument number