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 000001c2a741$ccfde7a0$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.





---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?



pgsql-general by date:

Previous
From: frbn
Date:
Subject: Re: SQL alternative to pg_dump
Next
From: Christoph Dalitz
Date:
Subject: Aggregate working on ordered data