Re: date and time

Поиск
Список
Период
Сортировка
От Alain Roger
Тема Re: date and time
Дата
Msg-id 75645bbb0803240745l43023c17g9668a3cf09219f2c@mail.gmail.com
обсуждение исходный текст
Ответ на Re: date and time  (Raymond O'Donnell <rod@iol.ie>)
Ответы Re: date and time  (Thomas Kellerer <spam_eater@gmx.net>)
Re: date and time  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general
Hi Ray,

yes for sure. Here it is:
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);

On Mon, Mar 24, 2008 at 3:42 PM, Raymond O'Donnell <rod@iol.ie> wrote:
On 24/03/2008 14:35, Alain Roger wrote:
> for that i use "select * from now();" and store the result into a column
> table.
>
> is there a easier way to do that ? i tried to store directly now();
> result but without success.

Can you show us the full SQL statement?

You could also use CURRENT_TIMESTAMP - look at the following:

http://www.postgresql.org/docs/8.3/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT

HTH,

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------



--
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 по дате отправления:

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