Re: SELECT EXTRACT doesn't work with variables?

From: Conxita Marín <comarin(at)telefonica(dot)net>
To: <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "'Masaru Sugawara'" <rk73(at)sea(dot)plala(dot)or(dot)jp>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: SELECT EXTRACT doesn't work with variables?
Date: 2002-12-19 09:34:15
Message-ID: 000001c2a741$ccfde7a0$0cd8a8c0@dims
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: miércoles, 18 de diciembre de 2002 17:00
To: Masaru Sugawara
Cc: cmarin(at)dims(dot)com; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] SELECT EXTRACT doesn't work with variables?

Masaru Sugawara <rk73(at)sea(dot)plala(dot)or(dot)jp> writes:
> Conxita Marín <comarin(at)telefonica(dot)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?

Browse pgsql-general by date

  From Date Subject
Next Message Christoph Dalitz 2002-12-19 09:40:31 Aggregate working on ordered data
Previous Message frbn 2002-12-19 09:05:45 Re: SQL alternative to pg_dump