Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 53BA5475FA9 for ; Wed, 5 Jun 2002 14:22:36 -0400 (EDT) Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.236.160]) by postgresql.org (Postfix) with ESMTP id 4F69E475D90 for ; Wed, 5 Jun 2002 14:19:15 -0400 (EDT) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 17FfOw-0002yz-00 for ; Wed, 05 Jun 2002 12:20:54 -0600 Date: Wed, 5 Jun 2002 12:20:54 -0600 From: Roberto Mello To: pgsql-sql@postgresql.org Subject: extract and variables in PL/pgSQL Message-ID: <20020605182054.GA1307@cc.usu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.3.28i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. X-Archive-Number: 200206/40 X-Sequence-Number: 8005 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