X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7F0A93A52EA for ; Tue, 30 Nov 2004 04:22:42 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 28018-07 for ; Tue, 30 Nov 2004 04:22:39 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.250.190.2]) by svr1.postgresql.org (Postfix) with ESMTP id 852D43A442D for ; Tue, 30 Nov 2004 04:22:38 +0000 (GMT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id AE38F31923; Tue, 30 Nov 2004 05:22:37 +0100 (MET) From: Christopher Browne X-Newsgroups: pgsql.sql Subject: Re: create stored procedure from temporary table Date: Mon, 29 Nov 2004 23:09:14 -0500 Organization: cbbrowne Computing Inc Lines: 14 Message-ID: References: <00de01c4d688$4bc0cf40$8a030b0a@JACARTA.CMACGM.COM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux) Cancel-Lock: sha1:DH45OqItKpeZEolFuHp4CKcju/U= To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/293 X-Sequence-Number: 19611 Oops! dja.mnurdin@cma-cgm.com ("Nurdin") was seen spray-painting on a wall: > i was wondering, how to create dynamic table like temporary table > but create from function and the result from function too....cos i > want count same calculation from other table migh be a multiple > table so i need looping and join table... Well, you can define a temporary table inside a stored procedure using EXECUTE, as long as all of the operations that touch that table are kept inside dynamic SQL invoked using EXECUTE... -- output = reverse("moc.liamg" "@" "enworbbc") http://www.ntlug.org/~cbbrowne/oses.html "Bonus! The lack of multitasking is one of the most important reasons why DOS destroyed Unix in the marketplace." -- Scott Nudds