extract and variables in PL/pgSQL - Mailing list pgsql-sql

From Roberto Mello
Subject extract and variables in PL/pgSQL
Date
Msg-id 20020605182054.GA1307@cc.usu.edu
Whole thread Raw
Responses Re: extract and variables in PL/pgSQL  (Jan Wieck <janwieck@yahoo.com>)
List pgsql-sql
Hi,

Someone in another list asked about this function. I'm not sure why it
doesn't work. What am I missing? 

CREATE FUNCTION zastras(timestamp) RETURNS integer AS '
declare w_temp1 alias for $1; w_result integer;
begin SELECT INTO w_result EXTRACT(epoch from timestamp w_temp1);  return w_result;

end;
' language 'plpgsql';

NOTICE:  Error occurred while executing PL/pgSQL function zastras
NOTICE:  line 5 at select into variables


Thanks,

-Roberto

-- 
+----| http://fslc.usu.edu/ USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU -
http://www.brasileiro.net/      http://www.sdl.usu.edu/ - Space Dynamics Lab, Developer    
 
I wonder what this button does? *&^(&^)#@$*&_% NO CARRIER


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Indexing Metaphone?
Next
From: Roberto Mello
Date:
Subject: Getting PID of current logged user