Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id A5634475998 for ; Tue, 2 Jul 2002 01:25:08 -0400 (EDT) Mailbox-Line: From rmello@cc.usu.edu Tue Jul 2 01:25:08 2002 Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.236.160]) by postgresql.org (Postfix) with ESMTP id CC3324759C3 for ; Tue, 2 Jul 2002 01:23:40 -0400 (EDT) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 17PG8Z-0007V8-00; Mon, 01 Jul 2002 23:23:39 -0600 Date: Mon, 1 Jul 2002 23:23:38 -0600 From: Roberto Mello To: Ferenc Engard Cc: pgsql-sql@postgresql.org Subject: Re: pl/pgsql capabilities? Message-ID: <20020702052338.GA28472@cc.usu.edu> References: <3D1F97A1.B4B25B32@all.hu> <20020701144047.GB23653@cc.usu.edu> <3D20E7A4.436ED3FD@all.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <3D20E7A4.436ED3FD@all.hu> User-Agent: Mutt/1.3.28i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. X-Spam-Status: No, hits=-3.5 required=5.0 tests=IN_REP_TO,SUBJ_ENDS_IN_Q_MARK version=2.30 X-Spam-Level: X-Archive-Number: 200207/13 X-Sequence-Number: 8392 On Tue, Jul 02, 2002 at 01:37:08AM +0200, Ferenc Engard wrote: > > If I understand well, I can create a cursor for a SELECT statement, and > return that cursor. Well, it is better than nothing, but I fear it is > not flexible enogh for me. Maybe not for the solution you have right now, but you most likely can rework things a bit to make it work. > Here is an example from an interbase app. I have to declare that this is > not my program, and I do not know IB, so forgive me if I say silly > things... > > CREATE PROCEDURE VIEW_1_1 > ( > SZEMPONTID INTEGER, > PARENT CHAR(10) CHARACTER SET WIN1250, > ELNEVEZESTIPUSID INTEGER, > RENDSZERKOD CHAR(16) CHARACTER SET WIN1250 > ) ... > The point is not what this proc does (in summary, it gets all the childs > with their properties of a parent in a tree structure), but it cannot > gather all the information with just one select, e.g. it gets some data > from another (nontrivial) stored procedure. > > As I see, that 'suspend' command gives back the actual row (and the > control) to the caller until it fetches the next row from this proc's > return value. Do I interpret correct that this stored proc returns a > cursor with structure described in the 'RETURNS' part, and which is not > linked to a SELECT statement? > > Can I do something similar in PG? If not now, maybe in the (near) > future? Not in the way you currently have, as far as I could understand it. I didn't read the procedure very attentively because it's horribly written in all caps, and my eyes started scrambling the letters half way through. -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 "Data! I thought you were dead!" "No, Sir. I rebooted."