Re: date and time

From: "Alain Roger" <raf(dot)news(at)gmail(dot)com>
To: "Thomas Kellerer" <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: date and time
Date: 2008-03-24 15:15:48
Message-ID: 75645bbb0803240815i20393e41v6c7ef8de7736e8b5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

So thanks a lot to everybody... so here is the result.

1. the semicolon was missing after the INSERT as wrote Raymond.
2. CURRENT_TIMESTAMP works great
3. i use pl/pgsql as language

thanks again.
Alain

On Mon, Mar 24, 2008 at 3:56 PM, Thomas Kellerer <spam_eater(at)gmx(dot)net> wrote:

> Alain Roger wrote on 24.03.2008 15:45:
> >> SELECT count(*) INTO existing_email FROM cust_portal.tmp_newsletterreg;
> >> if (existing_email <>0) then
> >> {
> >> result = false;
> >> }
> >> else
> >> {
> >> result = true;
> >> INSERT INTO cust_portal.tmp_newsletterreg VALUES
> >> (
> >> nextval( 'tmp_newsletterreg_nlreg_id_seq' ),
> >> email,
> >> session,
> >> SELECT CURRENT_TIMESTAMP;
> >> )
> >> }
> >> end if;
> >>
> >> RETURN(result);
>
>
> That should be
>
> INSERT INTO cust_portal.tmp_newsletterreg VALUES
> (
> nextval( 'tmp_newsletterreg_nlreg_id_seq' ),
> email,
> session,
> CURRENT_TIMESTAMP
> )
>
> There is no SELECT and no semicolon inside the INSERT
>
> Thomas
>
>
> -
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2008-03-24 16:14:14 Re: date and time
Previous Message Edoardo Panfili 2008-03-24 15:01:24 Re: C function and enum types parameters