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 1DA1953724 for ; Thu, 14 Apr 2005 12:01:07 -0300 (ADT) 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 97763-08 for ; Thu, 14 Apr 2005 15:01:05 +0000 (GMT) Received: from secf.com (209-128-104-244.bayarea.net [209.128.104.244]) by svr1.postgresql.org (Postfix) with ESMTP id 457BB53F8C for ; Thu, 14 Apr 2005 12:01:04 -0300 (ADT) Received: from dinesh by secf.com (MDaemon.PRO.v7.2.2.R) with ESMTP id md50000633583.msg for ; Thu, 14 Apr 2005 08:00:24 -0700 Reply-To: From: "Dinesh Pandey" To: "'Tom Lane'" Cc: "'PostgreSQL'" Subject: Re: dynamic 'INSERT' query? Date: Thu, 14 Apr 2005 20:27:46 +0530 Organization: Second Foundation India P Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcVBAbbxGsSPlARtRC2+jib20x9jzQAAAYjg In-Reply-To: <564.1113490394@sss.pgh.pa.us> X-Authenticated-Sender: dpandey@secf.com X-Spam-Processed: mail.secf.com, Thu, 14 Apr 2005 08:00:24 -0700 (not processed: message from valid local sender) X-MDRemoteIP: 220.227.32.11 X-Return-Path: dpandey@secf.com X-MDaemon-Deliver-To: pgsql-sql@postgresql.org X-MDAV-Processed: mail.secf.com, Thu, 14 Apr 2005 08:00:27 -0700 Message-Id: <20050414150104.457BB53F8C@svr1.postgresql.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.508 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, MSGID_FROM_MTA_ID, UPPERCASE_25_50 X-Spam-Level: * X-Archive-Number: 200504/195 X-Sequence-Number: 21088 Yes here the TABLE NAME is also coming at runtime. Like In Oracle I have done in this way: ------------------------------------------- LOOP v_sql := 'INSERT INTO ' || mytable || ' VALUES(:in_sentryid_id, :in_node_id)'; EXECUTE IMMEDIATE v_sql USING v_sentryid, v_nodeid; END LOOP; How to convert this into Postgres????? Thanks Dinesh Pandey