Re: [GENERAL] date and time

2008-03-24 Thread Tony Caduto
Alain Roger wrote: Hi, i have a stored procedure (a function) in which i must generate a date/time stamp. 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. Do you

Re: [GENERAL] date and time

2008-03-24 Thread Alain Roger
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 On Mon, Mar 24, 2008 at 3:56 PM, Thomas Kellerer <[EMAIL PROTECTED]> wrote: > Alain Roger wro

Re: [GENERAL] date and time

2008-03-24 Thread Raymond O'Donnell
On 24/03/2008 14:45, Alain Roger wrote: INSERT INTO cust_portal.tmp_newsletterreg VALUES ( nextval( 'tmp_newsletterreg_nlreg_id_seq' ), email, session, SELECT CURRENT_TIMESTAMP; > ) Hi Alain, That won't work; you just need ... values ( email, session, CURRENT_TIMESTAMP) CURRENT

Re: [GENERAL] date and time

2008-03-24 Thread Thomas Kellerer
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 (

Re: [GENERAL] date and time

2008-03-24 Thread Adrian Klaver
On Monday 24 March 2008 7:35 am, Alain Roger wrote: > Hi, > > i have a stored procedure (a function) in which i must generate a date/time > stamp. > 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

Re: [GENERAL] date and time

2008-03-24 Thread Alain Roger
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 >

Re: [GENERAL] date and time

2008-03-24 Thread Raymond O'Donnell
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_TIMESTAM