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 3585C53DFD for ; Thu, 14 Apr 2005 11:31:54 -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 84771-08 for ; Thu, 14 Apr 2005 14:31:45 +0000 (GMT) Received: from secf.com (209-128-104-244.bayarea.net [209.128.104.244]) by svr1.postgresql.org (Postfix) with ESMTP id 1704853689 for ; Thu, 14 Apr 2005 11:31:44 -0300 (ADT) Received: from dinesh by secf.com (MDaemon.PRO.v7.2.2.R) with ESMTP id md50000633427.msg for ; Thu, 14 Apr 2005 07:31:18 -0700 Reply-To: From: "Dinesh Pandey" To: "'PostgreSQL'" Subject: Prepared query ? Date: Thu, 14 Apr 2005 19:58:40 +0530 Organization: Second Foundation India P Ltd. MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0040_01C5412C.5CBEECF0" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcVA/kDYtJp2cTBFSmux6F0CMh1A/A== X-Authenticated-Sender: dpandey@secf.com X-Spam-Processed: mail.secf.com, Thu, 14 Apr 2005 07:31:18 -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 07:31:20 -0700 Message-Id: <20050414143144.1704853689@svr1.postgresql.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.496 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, HTML_90_100, HTML_MESSAGE, MSGID_FROM_MTA_ID X-Spam-Level: * X-Archive-Number: 200504/191 X-Sequence-Number: 21084 This is a multi-part message in MIME format. ------=_NextPart_000_0040_01C5412C.5CBEECF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit How can I 1. Write a prepared query and 2. Set values at run time and 3. Execute that query for different values. LOOP ... ... sql := INSERT INTO MYTABLE VALUES(?, ?); .. --EXECUTE (sql); END LOOP; Regards Dinesh Pandey ---------------------------------------------------------------------------- ------ Dinesh Pandey Sr. Software Engineer Second Foundation (India) Pvt. Ltd. Plot# 52 Industrial Area, Phase II Chandigarh. (India) PH: (O) 0172-2639202, Extn: 233 ------=_NextPart_000_0040_01C5412C.5CBEECF0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

How can I

  1. Write a prepared = query and
  2. Set values at run = time and
  3. Execute that query = for different values.

 

LOOP<= /p>

     = …..

     = …..

sql = :=3D INSERT INTO MYTABLE VALUES(?, ?);

……<= /span>

--EXECUTE = (sql);

END LOOP;

 

Regards
Dinesh Pandey



-----------------------------------= -----------------------------------------------
<= /font>
Dinesh = Pandey 
Sr. Software Engineer

Second Foundation (India) Pvt. Ltd.
Plot# 52
Industrial Area, Phase II
Chandigarh. (India)
PH: (O) 0172-2639202, Extn: 233

 

------=_NextPart_000_0040_01C5412C.5CBEECF0--