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@xxxxxx> wrote:
On 24/03/2008 14:35, Alain Roger wrote:Can you show us the full SQL statement?
> 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.
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@xxxxxx
---------------------------------------------------------------
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008