X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 846ABD1B980 for ; Tue, 24 Feb 2004 15:35:11 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 77611-04 for ; Tue, 24 Feb 2004 11:35:13 -0400 (AST) Received: from ind-iport-1.cisco.com (ind-iport-1-sec.cisco.com [64.104.129.9]) by svr1.postgresql.org (Postfix) with ESMTP id F40EBD1B4C5 for ; Tue, 24 Feb 2004 11:35:07 -0400 (AST) Received: from india-core-1.cisco.com (64.104.129.221) by ind-iport-1.cisco.com with ESMTP; 25 Feb 2004 02:40:10 +0530 Received: from cisco.com (charminar.cisco.com [192.135.240.11]) by india-core-1.cisco.com (8.12.10/8.12.6) with ESMTP id i1OFYwWT021011; Tue, 24 Feb 2004 07:34:59 -0800 (PST) Received: from sbiswasw2k01 (dhcp-10-77-21-42.cisco.com [10.77.21.42]) by cisco.com (8.8.8-Cisco List Logging/8.8.8) with ESMTP id VAA17141; Tue, 24 Feb 2004 21:03:09 +0530 (IST) Reply-To: From: "Sumita Biswas (sbiswas)" To: "'Tom Lane'" Cc: Subject: Execute Query in Postgres Function Date: Tue, 24 Feb 2004 21:05:07 +0530 Organization: cisco systems Message-ID: <003901c3faeb$c7d1cd60$2a154d0a@apac.cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 Importance: Normal In-Reply-To: <20409.1077506948@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/390 X-Sequence-Number: 17080 How do we execute a Query String in Postgresql function? Or what is the equivalent of the following Code in MSSQL Stored Procedure: SET @QueryToPopulateTemp = "INSERT INTO #Tmp_ConferenceDetail(ConferenceType, ConnectTime, DisconnectTime,DestConversationId, Duration, AppConfId, OrigDeviceName, DestDeviceName, destLegIdentifier) " + "SELECT * FROM Tbl_Billing_Data "; EXEC sp_executesql @QueryToPopulateTemp; Thanks for any inputs. Regards, Sumita