Re: date and time

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: date and time
Дата
Msg-id fs8ffb$ji1$1@ger.gmane.org
обсуждение исходный текст
Ответ на Re: date and time  ("Alain Roger" <raf.news@gmail.com>)
Ответы Re: date and time  ("Alain Roger" <raf.news@gmail.com>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: date and time
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: date and time