Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f17DgYx51169 for ; Wed, 7 Feb 2001 08:42:34 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from c000.muc.cp.net (c000-h017.c000.muc.cp.net [209.228.29.103]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f1750Ax86365 for ; Wed, 7 Feb 2001 00:00:11 -0500 (EST) (envelope-from deepaji@chequemail.com) Received: (cpmta 24669 invoked from network); 7 Feb 2001 05:00:09 +0000 Date: 7 Feb 2001 05:00:09 +0000 Message-ID: <20010207050009.24668.cpmta@c000.muc.cp.net> X-Sent: 7 Feb 2001 05:00:09 GMT Received: from [202.144.45.90] by mail.chequemail.com with HTTP; 07 Feb 2001 05:00:09 GMT Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 To: pgsql-sql@postgresql.org From: deepaji@chequemail.com X-Mailer: Web Mail 3.8.1.2 Subject: Returning a row from a function X-Archive-Number: 200102/115 X-Sequence-Number: 1293 Hi, This is my first experinece in writing to u. Please excuse any obvious errors. I have only recently started using the postgres database and i would like to know if it is possible to return a record from the fucntion(both sql and plpgsql). I tried this code.. but the reuslt i got was create function ret_rec(char(10)) returns setof label as ' select * from label where label_id = $1' language 'sql'; hmv=# select ret_rec('L0001'); ?column? ----------- 136449928 I also tried this.. create function ret_rec(char(10)) returns label as ' declare label_rec record; begin select into label_rec * from label where label_id = $1; return label_rec; end;' language 'plpgsql'; hmv=# select ret_rec('L0001'); ret_rec ----------- 136469400 (1 row) What is the problem and what is this value that is being returned? Is there any other way in which i can handle this? Please help. Also, please tell me if there is any way in which i can pass values to a plpgsql function that is being called by a trigger?(ie) this function exceutes when a trigger fires.. can i pass arguments to this function? Regards and Thanx in advance Deepa. Chequemail.com - a free web based e-mail service that also pays!!! http://www.chequemail.com