Re: date and time

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: date and time
Date: 2008-03-24 14:56:44
Message-ID: fs8ffb$ji1$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2008-03-24 14:57:10 Re: date and time
Previous Message Adrian Klaver 2008-03-24 14:51:17 Re: date and time