Search Postgresql Archives

Re: date and time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 mean something like this:

CREATE OR REPLACE FUNCTION "public"."test"()
RETURNS timestamp  AS
$BODY$
DECLARE
mydate_var timestamp;

BEGIN
--store the current timestamp  in a variable
mydate_var = now();

RETURN mydate_var;


END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;


Later,

Tony Caduto
AM Software
http://www.amsoftwaredesign.com
Home of Lightning Admin for PostgreSQL and MySQL

-
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux