Re: date and time
От | Alain Roger |
---|---|
Тема | Re: date and time |
Дата | |
Msg-id | 75645bbb0803240815i20393e41v6c7ef8de7736e8b5@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: date and time (Thomas Kellerer <spam_eater@gmx.net>) |
Список | 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
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
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@gmx.net> wrote:
Alain Roger wrote on 24.03.2008 15:45:>> SELECT count(*) INTO existing_email FROM cust_portal.tmp_newsletterreg;That should be
>> 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);CURRENT_TIMESTAMP
INSERT INTO cust_portal.tmp_newsletterreg VALUES
(
nextval( 'tmp_newsletterreg_nlreg_id_seq' ),
email,
session,
)
There is no SELECT and no semicolon inside the INSERT
Thomas
-
Sent via pgsql-general mailing list (pgsql-general@postgresql.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
В списке pgsql-general по дате отправления: