Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFfht-0004zF-7d for pgsql-odbc@arkaria.postgresql.org; Wed, 22 Jun 2016 10:48:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bFfhs-0002DH-Bf for pgsql-odbc@arkaria.postgresql.org; Wed, 22 Jun 2016 10:48:28 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bFfhr-0002D8-RK for pgsql-odbc@postgresql.org; Wed, 22 Jun 2016 10:48:27 +0000 Received: from mail2.asahi-net.or.jp ([202.224.39.198]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFfhn-0004oe-Ss for pgsql-odbc@postgresql.org; Wed, 22 Jun 2016 10:48:26 +0000 Received: from [192.168.1.3] (h216215.dynamic.ppp.asahi-net.or.jp [61.114.216.215]) by mail2.asahi-net.or.jp (Postfix) with ESMTP id 5ACD66D92; Wed, 22 Jun 2016 19:48:20 +0900 (JST) Subject: Re: Issue with Save and Release points To: daniel.machet@accenture.com References: <2469e362195c475898c777212b68b244@CO2PR4202MB0281.048d.mgd.msft.net> <0A3221C70F24FB45833433255569204D1F595BEB@G01JPEXMBYT05> <78e9da35a70c4ff1bfce5bde393934fc@SN4PR4207MB0382.048d.mgd.msft.net> <57647FB5.6020001@dream.email.ne.jp> <459e27de37af434388e31f95aca14b82@SN4PR4207MB0382.048d.mgd.msft.net> <5767F085.8050808@dream.email.ne.jp> <5ccb64c391ce49fc9ca27e7c0d23c156@SN4PR4207MB0382.048d.mgd.msft.net> <57687B46.9000400@dream.email.ne.jp> Cc: tsunakawa.takay@jp.fujitsu.com, e.ratnakar.shetty@accenture.com, pgsql-odbc@postgresql.org From: "Inoue, Hiroshi" Message-ID: <576A6CF6.6030106@dream.email.ne.jp> Date: Wed, 22 Jun 2016 19:48:22 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------050108060104030109040304" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org This is a multi-part message in MIME format. --------------050108060104030109040304 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Daniel, On 2016/06/21 17:33, daniel.machet@accenture.com wrote: > > Thanks Hiroshi, > > Is there anywhere I can do some reading up about the SQLStatistics() > function and how to cache its results so that ODBC doesn’t need to run > these repeatedly for each statement? Will I be able to call > SQLStatistics() from VBA? > One way is to PREPARE an insert statement and EXECUTE the PREPARED statement repeatedly. > On a separate note – another way to tackle this might be to issue bulk > insert statements but my approach so far has been to issue bulk > statements using the postgres syntax from vba > > i.e. to populate a string with an insert statement like > > INSERT INTO tblA(field1, field2) VALUES > > (1, 999), > > (2, 888); > > And to issue via the driver using following: > > ThisDB.Execute strSQL, dbFailOnError > > ThisDB is created using : > > Set ThisDB = OpenDatabase("", False, False, DBName) > > But I keep getting a syntax error for missing ; even though this exact > query works on pgAdmin > OpenDatabase() seems a DAO method. Unfortunately it seems DAO( or Access) doesn't allow to insert multiple rows. regards, Hiroshi Inoue --------------050108060104030109040304 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Hi Daniel,

On 2016/06/21 17:33, daniel.machet@accenture.com wrote:

Thanks Hiroshi,

 

Is there anywhere I can do some reading up about the SQLStatistics() function and how to cache its results so that ODBC doesn’t need to run these repeatedly for each statement? Will I be able to call SQLStatistics() from VBA?


One way is to PREPARE an insert statement and EXECUTE the PREPARED statement repeatedly.


 

On a separate note – another way to tackle this might be to issue bulk insert statements but my approach so far has been to issue bulk statements using the postgres syntax from vba

 

i.e. to populate a string with an insert statement like

 

INSERT INTO tblA(field1, field2) VALUES

(1, 999),

(2, 888);

 

And to issue via the driver using following:

 

ThisDB.Execute strSQL, dbFailOnError

 

 

ThisDB is created using :

 

Set ThisDB = OpenDatabase("", False, False, DBName)

 

But I keep getting a syntax error for missing ; even though this exact query works on pgAdmin


OpenDatabase() seems a DAO method.
Unfortunately it seems DAO( or Access) doesn't allow to insert multiple rows.

regards,
Hiroshi Inoue
--------------050108060104030109040304--