pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Issue with Save and Release points
16+ messages / 5 participants
[nested] [flat]

* Issue with Save and Release points
@ 2016-06-16 16:21  e.ratnakar.shetty@accenture.com
  0 siblings, 1 reply; 16+ messages in thread

From: e.ratnakar.shetty@accenture.com @ 2016-06-16 16:21 UTC (permalink / raw)
  To: pgsql-odbc; +Cc: daniel.machet@accenture.com

Hi,

We are using psqlodbc_09_05_0100-x86 driver to connect to Postgres 9.4 version through a VB app. When we try running continuous inserts from the application, the performance is really slow (18 minutes for upto a lakh records). On monitoring the logs, we found that there are huge number of save release point executions happening.

duration: 0.000 ms
2016-06-16 17:06:40 BST LOG:  statement: RELEASE _EXEC_SVP_1B107E
2016-06-16 17:06:40 BST LOG:  duration: 0.000 ms
2016-06-16 17:06:40 BST LOG:  statement: SAVEPOINT _EXEC_SVP_1B1082F8
2016-06-16 17:06:40 BST LOG:  duration: 0.000 ms

We tried switching this off by setting the "level of Rollback on error" to Nop and also through the connection string in the application but the logs still show these executions. Any pointers as to what might be causing this issue?

Many Thanks

Regards,
Eisha Shetty
ACCENTURE | UK-NEWCASTLE
* +44 7741587433
* e.ratnakar.shetty@accenture.com<mailto:e.ratnakar.shetty@accenture.com>
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-17 01:41  Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
  parent: e.ratnakar.shetty@accenture.com
  0 siblings, 1 reply; 16+ messages in thread

From: Tsunakawa, Takayuki @ 2016-06-17 01:41 UTC (permalink / raw)
  To: e.ratnakar.shetty@accenture.com <e.ratnakar.shetty@accenture.com>; pgsql-odbc; +Cc: daniel.machet@accenture.com <daniel.machet@accenture.com>

From: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of e.ratnakar.shetty@accenture.com
We tried switching this off by setting the $B!H(Blevel of Rollback on error$B!I(B to Nop and also through the connection string in the application but the logs still show these executions. Any pointers as to what might be causing this issue?

Could you try setting that item to $B!H(BTransaction$B!I(B?

Regards
Takayuki Tsunakawa

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-17 14:28  daniel.machet@accenture.com
  parent: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
  0 siblings, 1 reply; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-17 14:28 UTC (permalink / raw)
  To: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Thanks Takayuki,

We've tried with Transaction but are still seeing save points and release points in the postgres logs. Also on executing the same query on localhost (from my laptop) am getting slow performance (around 4 records per second).

We don't see same performance drawback on inserting directly on the client

Regards
Daniel Machet
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


From: Tsunakawa, Takayuki [mailto:tsunakawa.takay@jp.fujitsu.com]
Sent: 17 June 2016 02:41
To: Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
Cc: Machet, Daniel <daniel.machet@accenture.com>
Subject: RE: Issue with Save and Release points

From: pgsql-odbc-owner@postgresql.org<mailto:pgsql-odbc-owner@postgresql.org> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of e.ratnakar.shetty@accenture.com<mailto:e.ratnakar.shetty@accenture.com>
We tried switching this off by setting the "level of Rollback on error" to Nop and also through the connection string in the application but the logs still show these executions. Any pointers as to what might be causing this issue?

Could you try setting that item to "Transaction"?

Regards
Takayuki Tsunakawa

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-17 22:54  Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  parent: daniel.machet@accenture.com
  0 siblings, 3 replies; 16+ messages in thread

From: Inoue, Hiroshi @ 2016-06-17 22:54 UTC (permalink / raw)
  To: daniel.machet@accenture.com; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Hi Daniel,

Doesn't your connection string contain 'Protocol=7.4-2' option?
If so, please change it to 'Protocol=7.4-1'.

regards,
Hiroshi Inoue

On 2016/06/17 23:28, daniel.machet@accenture.com wrote:
>
> Thanks Takayuki,
>
> We’ve tried with Transaction but are still seeing save points and 
> release points in the postgres logs. Also on executing the same query 
> on localhost (from my laptop) am getting slow performance (around 4 
> records per second).
>
> We don’t see same performance drawback on inserting directly on the client
>
> Regards
>
> Daniel Machet
>
> ------------------------------------------------------------------------
>
> This message is for the designated recipient only and may contain 
> privileged, proprietary, or otherwise private information. If you have 
> received it in error, please notify the sender immediately and delete 
> the original. Any other use of the e-mail by you is prohibited. Where 
> allowed by local law, electronic communications with Accenture and its 
> affiliates, including e-mail and instant messaging (including 
> content), may be scanned by our systems for the purposes of 
> information security and assessment of internal compliance with 
> Accenture policy.
>
> Accenture means Accenture (UK) Limited (registered number 4757301), 
> registered in England and Wales with registered address at 30 
> Fenchurch Street, London EC3M 3BD.
>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-19 21:43  daniel.machet@accenture.com
  parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  2 siblings, 0 replies; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-19 21:43 UTC (permalink / raw)
  To: h-inoue@dream.email.ne.jp; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Hi Hiroshi,

Apologies for the delayed reply,

I'm not sure where to change the connection string to protocol=7.4-1

This is running psqlodbc35W driver on a windows system and when I try configuring it from odbcad32.exe , the protocol section isn't shown on page 2 or page 3

I tried adding that line verbose in ODBC.ini but same SAVEPOINT and RELEASEPOINT messages are seen for each statement. Also whenever I make a change to the odbc driver using the odbcad32.exe, it overwrites this and removes the 'protocol=7.4-1' statement I've added.

Regards
Dan
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 17 June 2016 23:55
To: Machet, Daniel <daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,

Doesn't your connection string contain 'Protocol=7.4-2' option?
If so, please change it to 'Protocol=7.4-1'.

regards,
Hiroshi Inoue
On 2016/06/17 23:28, daniel.machet@accenture.com<mailto:daniel.machet@accenture.com> wrote:
Thanks Takayuki,

We've tried with Transaction but are still seeing save points and release points in the postgres logs. Also on executing the same query on localhost (from my laptop) am getting slow performance (around 4 records per second).

We don't see same performance drawback on inserting directly on the client

Regards
Daniel Machet
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-19 23:17  daniel.machet@accenture.com
  parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  2 siblings, 0 replies; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-19 23:17 UTC (permalink / raw)
  To: h-inoue@dream.email.ne.jp; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Hi Hiroshi -

I've tried setting the protocol by typing Protocol=7.4-1 in the Connect Settings within the odbcad32.exe configuration and I've set Level of Rollback to 'Transaction' but I'm still seeing savepoints and release statements for each statement within the transaction.

On further analysis, it appears to be the  following query which happens in between the savepoints and Release statements which is taking up majority of the time and is having a significant impact on the time taken to insert around 57000 records:

select n.nspname, c.relname, a.attname, a.atttypid, t.typname, a.attnum, a.attlen, a.atttypmod, a.attnotnull, c.relhasrules, c.relkind, c.oid, pg_get_expr(d.adbin, d.adrelid), case t.typtype when 'd' then t.typbasetype else 0 end, t.typtypmod, c.relhasoids from (((pg_catalog.pg_class c inner join pg_catalog.pg_namespace n on n.oid = c.relnamespace and c.relname like 'tblcontributions' and n.nspname like 'public') inner join pg_catalog.pg_attribute a on (not a.attisdropped) and a.attnum > 0 and a.attrelid = c.oid) inner join pg_catalog.pg_type t on t.oid = a.atttypid) left outer join pg_attrdef d on a.atthasdef and d.adrelid = a.attrelid and d.adnum = a.attnum order by n.nspname, c.relname, attnum
2016-06-15 09:49:51 BST LOG:  duration: 3.088 ms


Regards
Dan



________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


From: Machet, Daniel
Sent: 19 June 2016 22:44
To: 'Inoue, Hiroshi' <h-inoue@dream.email.ne.jp>
Cc: tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
Subject: RE: [ODBC] Issue with Save and Release points

Hi Hiroshi,

Apologies for the delayed reply,

I'm not sure where to change the connection string to protocol=7.4-1

This is running psqlodbc35W driver on a windows system and when I try configuring it from odbcad32.exe , the protocol section isn't shown on page 2 or page 3

I tried adding that line verbose in ODBC.ini but same SAVEPOINT and RELEASEPOINT messages are seen for each statement. Also whenever I make a change to the odbc driver using the odbcad32.exe, it overwrites this and removes the 'protocol=7.4-1' statement I've added.

Regards
Dan
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.

From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 17 June 2016 23:55
To: Machet, Daniel <daniel.machet@accenture.com<mailto:daniel.machet@accenture.com>>
Cc: tsunakawa.takay@jp.fujitsu.com<mailto:tsunakawa.takay@jp.fujitsu.com>; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com<mailto:e.ratnakar.shetty@accenture.com>>; pgsql-odbc@postgresql.org<mailto:pgsql-odbc@postgresql.org>
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,

Doesn't your connection string contain 'Protocol=7.4-2' option?
If so, please change it to 'Protocol=7.4-1'.

regards,
Hiroshi Inoue
On 2016/06/17 23:28, daniel.machet@accenture.com<mailto:daniel.machet@accenture.com> wrote:
Thanks Takayuki,

We've tried with Transaction but are still seeing save points and release points in the postgres logs. Also on executing the same query on localhost (from my laptop) am getting slow performance (around 4 records per second).

We don't see same performance drawback on inserting directly on the client

Regards
Daniel Machet
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-20 08:38  daniel.machet@accenture.com
  parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  2 siblings, 1 reply; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-20 08:38 UTC (permalink / raw)
  To: h-inoue@dream.email.ne.jp; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Hi Hiroshi,

Please find attached the mylog from when the job runs (have only switched on for 1 run and then switched off due to the time cost from this)

Regards
Dan

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 17 June 2016 23:55
To: Machet, Daniel <daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,

Doesn't your connection string contain 'Protocol=7.4-2' option?
If so, please change it to 'Protocol=7.4-1'.

regards,
Hiroshi Inoue
On 2016/06/17 23:28, daniel.machet@accenture.com<mailto:daniel.machet@accenture.com> wrote:
Thanks Takayuki,

We've tried with Transaction but are still seeing save points and release points in the postgres logs. Also on executing the same query on localhost (from my laptop) am getting slow performance (around 4 records per second).

We don't see same performance drawback on inserting directly on the client

Regards
Daniel Machet
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Attachments:

  mylog.txt (text/plain, 107.8K) download

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-20 13:32  Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  parent: daniel.machet@accenture.com
  0 siblings, 1 reply; 16+ messages in thread

From: Inoue, Hiroshi @ 2016-06-20 13:32 UTC (permalink / raw)
  To: daniel.machet@accenture.com; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Hi Daniel,

Looks like the log is a part of SQLStatistics call.
If SQLStatistics calls for a table are repeated, maybe the driver had 
better cache the result.

regards,
Hiroshi Inoue

On 2016/06/20 17:38, daniel.machet@accenture.com wrote:
>
> Hi Hiroshi,
>
> Please find attached the mylog from when the job runs (have only 
> switched on for 1 run and then switched off due to the time cost from 
> this)
>
> Regards
>
> Dan
>
> ------------------------------------------------------------------------
>
> This message is for the designated recipient only and may contain 
> privileged, proprietary, or otherwise private information. If you have 
> received it in error, please notify the sender immediately and delete 
> the original. Any other use of the e-mail by you is prohibited. Where 
> allowed by local law, electronic communications with Accenture and its 
> affiliates, including e-mail and instant messaging (including 
> content), may be scanned by our systems for the purposes of 
> information security and assessment of internal compliance with 
> Accenture policy.
>
> Accenture means Accenture (UK) Limited (registered number 4757301), 
> registered in England and Wales with registered address at 30 
> Fenchurch Street, London EC3M 3BD.
>
> *From:*Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
> *Sent:* 17 June 2016 23:55
> *To:* Machet, Daniel <daniel.machet@accenture.com>
> *Cc:* tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. 
> <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
> *Subject:* Re: [ODBC] Issue with Save and Release points
>
> Hi Daniel,
>
> Doesn't your connection string contain 'Protocol=7.4-2' option?
> If so, please change it to 'Protocol=7.4-1'.
>
> regards,
> Hiroshi Inoue
>
> On 2016/06/17 23:28, daniel.machet@accenture.com 
> <mailto:daniel.machet@accenture.com> wrote:
>
>     Thanks Takayuki,
>
>     We’ve tried with Transaction but are still seeing save points and
>     release points in the postgres logs. Also on executing the same
>     query on localhost (from my laptop) am getting slow performance
>     (around 4 records per second).
>
>     We don’t see same performance drawback on inserting directly on
>     the client
>
>     Regards
>
>     Daniel Machet
>
>     ------------------------------------------------------------------------
>
>     This message is for the designated recipient only and may contain
>     privileged, proprietary, or otherwise private information. If you
>     have received it in error, please notify the sender immediately
>     and delete the original. Any other use of the e-mail by you is
>     prohibited. Where allowed by local law, electronic communications
>     with Accenture and its affiliates, including e-mail and instant
>     messaging (including content), may be scanned by our systems for
>     the purposes of information security and assessment of internal
>     compliance with Accenture policy.
>
>     Accenture means Accenture (UK) Limited (registered number
>     4757301), registered in England and Wales with registered address
>     at 30 Fenchurch Street, London EC3M 3BD.
>
>
>
> このメッセージにウイルス は検出されませんでした。
> AVG によってチェックされました - www.avg.com <http://www.avg.com;
> バージョン: 2016.0.7640 / ウイルスデータベース:4604/12454 - リリース 
> 日:2016/06/19
>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-20 13:58  daniel.machet@accenture.com
  parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  0 siblings, 1 reply; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-20 13:58 UTC (permalink / raw)
  To: h-inoue@dream.email.ne.jp; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Hi Hiroshi,

This is repeated about 2 times for each INSERT statement, how would I go about changing the driver to cache the result? (I tried switching on connection pooling for the Postgres Unicode driver with a 60 second timeout but those queries didn’t reduce).

Regards
Dan

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 20 June 2016 14:33
To: Machet, Daniel <daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,

Looks like the log is a part of SQLStatistics call.
If SQLStatistics calls for a table are repeated, maybe the driver had better cache the result.

regards,
Hiroshi Inoue
On 2016/06/20 17:38, daniel.machet@accenture.com<mailto:daniel.machet@accenture.com> wrote:
Hi Hiroshi,

Please find attached the mylog from when the job runs (have only switched on for 1 run and then switched off due to the time cost from this)

Regards
Dan

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.



From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 17 June 2016 23:55
To: Machet, Daniel <daniel.machet@accenture.com><mailto:daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com<mailto:tsunakawa.takay@jp.fujitsu.com>; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com><mailto:e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org<mailto:pgsql-odbc@postgresql.org>
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,

Doesn't your connection string contain 'Protocol=7.4-2' option?
If so, please change it to 'Protocol=7.4-1'.

regards,
Hiroshi Inoue
On 2016/06/17 23:28, daniel.machet@accenture.com<mailto:daniel.machet@accenture.com> wrote:
Thanks Takayuki,

We’ve tried with Transaction but are still seeing save points and release points in the postgres logs. Also on executing the same query on localhost (from my laptop) am getting slow performance (around 4 records per second).

We don’t see same performance drawback on inserting directly on the client

Regards
Daniel Machet
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.




このメッセージにウイルス は検出されませんでした。
AVG によってチェックされました - www.avg.com<http://www.avg.com;
バージョン: 2016.0.7640 / ウイルスデータベース:4604/12454 - リリース日:2016/06/19



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-20 23:24  Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  parent: daniel.machet@accenture.com
  0 siblings, 1 reply; 16+ messages in thread

From: Inoue, Hiroshi @ 2016-06-20 23:24 UTC (permalink / raw)
  To: daniel.machet@accenture.com; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Hi Daniel,

Unfortunately it needs an implementation change.
If you hope, I would try to cache the result of SQLStatistics().

regards,
Hiroshi Inoue

On 2016/06/20 22:58, daniel.machet@accenture.com wrote:
>
> Hi Hiroshi,
>
> This is repeated about 2 times for each INSERT statement, how would I 
> go about changing the driver to cache the result? (I tried switching 
> on connection pooling for the Postgres Unicode driver with a 60 second 
> timeout but those queries didn’t reduce).
>
> Regards
>
> Dan
>
> ------------------------------------------------------------------------
>
> This message is for the designated recipient only and may contain 
> privileged, proprietary, or otherwise private information. If you have 
> received it in error, please notify the sender immediately and delete 
> the original. Any other use of the e-mail by you is prohibited. Where 
> allowed by local law, electronic communications with Accenture and its 
> affiliates, including e-mail and instant messaging (including 
> content), may be scanned by our systems for the purposes of 
> information security and assessment of internal compliance with 
> Accenture policy.
>
> Accenture means Accenture (UK) Limited (registered number 4757301), 
> registered in England and Wales with registered address at 30 
> Fenchurch Street, London EC3M 3BD.
>
> *From:*Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
> *Sent:* 20 June 2016 14:33
> *To:* Machet, Daniel <daniel.machet@accenture.com>
> *Cc:* tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. 
> <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
> *Subject:* Re: [ODBC] Issue with Save and Release points
>
> Hi Daniel,
>
> Looks like the log is a part of SQLStatistics call.
> If SQLStatistics calls for a table are repeated, maybe the driver had 
> better cache the result.
>
> regards,
> Hiroshi Inoue
>
> On 2016/06/20 17:38, daniel.machet@accenture.com 
> <mailto:daniel.machet@accenture.com> wrote:
>
>     Hi Hiroshi,
>
>     Please find attached the mylog from when the job runs (have only
>     switched on for 1 run and then switched off due to the time cost
>     from this)
>
>     Regards
>
>     Dan
>
>     ------------------------------------------------------------------------
>
>     This message is for the designated recipient only and may contain
>     privileged, proprietary, or otherwise private information. If you
>     have received it in error, please notify the sender immediately
>     and delete the original. Any other use of the e-mail by you is
>     prohibited. Where allowed by local law, electronic communications
>     with Accenture and its affiliates, including e-mail and instant
>     messaging (including content), may be scanned by our systems for
>     the purposes of information security and assessment of internal
>     compliance with Accenture policy.
>
>     Accenture means Accenture (UK) Limited (registered number
>     4757301), registered in England and Wales with registered address
>     at 30 Fenchurch Street, London EC3M 3BD.
>
>
>     *From:*Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
>     *Sent:* 17 June 2016 23:55
>     *To:* Machet, Daniel <daniel.machet@accenture.com>
>     <mailto:daniel.machet@accenture.com>
>     *Cc:* tsunakawa.takay@jp.fujitsu.com
>     <mailto:tsunakawa.takay@jp.fujitsu.com>; Ratnakar Shetty, E.
>     <e.ratnakar.shetty@accenture.com>
>     <mailto:e.ratnakar.shetty@accenture.com>;
>     pgsql-odbc@postgresql.org <mailto:pgsql-odbc@postgresql.org>
>     *Subject:* Re: [ODBC] Issue with Save and Release points
>
>     Hi Daniel,
>
>     Doesn't your connection string contain 'Protocol=7.4-2' option?
>     If so, please change it to 'Protocol=7.4-1'.
>
>     regards,
>     Hiroshi Inoue
>
>     On 2016/06/17 23:28, daniel.machet@accenture.com
>     <mailto:daniel.machet@accenture.com> wrote:
>
>         Thanks Takayuki,
>
>         We’ve tried with Transaction but are still seeing save points
>         and release points in the postgres logs. Also on executing the
>         same query on localhost (from my laptop) am getting slow
>         performance (around 4 records per second).
>
>         We don’t see same performance drawback on inserting directly
>         on the client
>
>         Regards
>
>         Daniel Machet
>
>         ------------------------------------------------------------------------
>
>         This message is for the designated recipient only and may
>         contain privileged, proprietary, or otherwise private
>         information. If you have received it in error, please notify
>         the sender immediately and delete the original. Any other use
>         of the e-mail by you is prohibited. Where allowed by local
>         law, electronic communications with Accenture and its
>         affiliates, including e-mail and instant messaging (including
>         content), may be scanned by our systems for the purposes of
>         information security and assessment of internal compliance
>         with Accenture policy.
>
>         Accenture means Accenture (UK) Limited (registered number
>         4757301), registered in England and Wales with registered
>         address at 30 Fenchurch Street, London EC3M 3BD.
>

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-21 08:33  daniel.machet@accenture.com
  parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  0 siblings, 1 reply; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-21 08:33 UTC (permalink / raw)
  To: h-inoue@dream.email.ne.jp; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

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?

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

Regards
Dan

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 21 June 2016 00:25
To: Machet, Daniel <daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,

Unfortunately it needs an implementation change.
If you hope, I would try to cache the result of SQLStatistics().

regards,
Hiroshi Inoue
On 2016/06/20 22:58, daniel.machet@accenture.com<mailto:daniel.machet@accenture.com> wrote:
Hi Hiroshi,

This is repeated about 2 times for each INSERT statement, how would I go about changing the driver to cache the result? (I tried switching on connection pooling for the Postgres Unicode driver with a 60 second timeout but those queries didn’t reduce).

Regards
Dan

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.



From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 20 June 2016 14:33
To: Machet, Daniel <daniel.machet@accenture.com><mailto:daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com<mailto:tsunakawa.takay@jp.fujitsu.com>; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com><mailto:e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org<mailto:pgsql-odbc@postgresql.org>
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,

Looks like the log is a part of SQLStatistics call.
If SQLStatistics calls for a table are repeated, maybe the driver had better cache the result.

regards,
Hiroshi Inoue
On 2016/06/20 17:38, daniel.machet@accenture.com<mailto:daniel.machet@accenture.com> wrote:
Hi Hiroshi,

Please find attached the mylog from when the job runs (have only switched on for 1 run and then switched off due to the time cost from this)

Regards
Dan

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.




From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 17 June 2016 23:55
To: Machet, Daniel <daniel.machet@accenture.com><mailto:daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com<mailto:tsunakawa.takay@jp.fujitsu.com>; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com><mailto:e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org<mailto:pgsql-odbc@postgresql.org>
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,

Doesn't your connection string contain 'Protocol=7.4-2' option?
If so, please change it to 'Protocol=7.4-1'.

regards,
Hiroshi Inoue
On 2016/06/17 23:28, daniel.machet@accenture.com<mailto:daniel.machet@accenture.com> wrote:
Thanks Takayuki,

We’ve tried with Transaction but are still seeing save points and release points in the postgres logs. Also on executing the same query on localhost (from my laptop) am getting slow performance (around 4 records per second).

We don’t see same performance drawback on inserting directly on the client

Regards
Daniel Machet
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-22 10:48  Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  parent: daniel.machet@accenture.com
  0 siblings, 3 replies; 16+ messages in thread

From: Inoue, Hiroshi @ 2016-06-22 10:48 UTC (permalink / raw)
  To: daniel.machet@accenture.com; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

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

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-22 11:00  daniel.machet@accenture.com
  parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  2 siblings, 0 replies; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-22 11:00 UTC (permalink / raw)
  To: h-inoue@dream.email.ne.jp; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc

Thanks again Hiroshi,


This has given me some direction, I’ll try recode to use a prepared statement (from a little googling this seems to imply using CreateQueryDef()
on vba… its for a word vba script but should be same across office)

I’ll also check if there are alternatives to DAO for opening the database connection… most likely this will be a bridge too far changewise but at least I’ll learn something

Regards
Dan

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 22 June 2016 11:48
To: Machet, Daniel <daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,
On 2016/06/21 17:33, daniel.machet@accenture.com<mailto: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


^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-22 13:53  Relyea, Mike <Mike.Relyea@xerox.com>
  parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  2 siblings, 1 reply; 16+ messages in thread

From: Relyea, Mike @ 2016-06-22 13:53 UTC (permalink / raw)
  To: pgsql-odbc; +Cc: daniel.machet@accenture.com <daniel.machet@accenture.com>

>> 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

Daniel,

If this is an Access limitation, you may be able to work around it by creating a pass-through query to run your SQL.  I use this function to create a pass-through on the fly.  I then run the query and delete it when I'm done.

Function DefineQuery(strName As String, _
                    strConnect As String, _
                    intTimeout As Integer, _
                    strSql As String, _
                    boolReturnsRecords As Boolean _
                    )
'A function to create a query given the listed parameters
On Error GoTo ErrorHandler
Dim db As dao.Database
Dim qrydef As dao.QueryDef
Dim StsBar As Variant

Set db = CurrentDb

StsBar = SysCmd(acSysCmdSetStatus, "Defining the query...")

db.QueryDefs.Delete (strName) 'Delete the query first if it exists
'Create the query
create_query:
Set qrydef = db.CreateQueryDef(strName)
    qrydef.Connect = strConnect
    qrydef.ODBCTimeout = intTimeout
    qrydef.sql = strSql
    qrydef.ReturnsRecords = boolReturnsRecords

StsBar = SysCmd(acSysCmdClearStatus)
    
ErrorHandler:
Select Case Err.Number
    Case 0
        Err.Clear
    Case 2501
        Err.Clear
    Case 3125
        MsgBox "The query name " & strName & " is not valid.  Make sure it does not contain any punctuation and is not longer than 64 characters."
    Case 3141
        MsgBox "I couldn't define the query."
    Case 3265
        Err.Clear
        GoTo create_query
    Case 3151
        MsgBox "Connection to database was lost.  Please close and reopen this program."
    Case 3359
        MsgBox "I couldn't create the query properly.  Please close and reopen this program."
    Case Else
        Dim test As Variant
        Dim strCommand As String
        strCommand = "Define Query"
        test = EmailError(Err.Number, Err.Description, strCommand)
End Select
End Function


Mike

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc


^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-23 21:26  daniel.machet@accenture.com
  parent: Relyea, Mike <Mike.Relyea@xerox.com>
  0 siblings, 0 replies; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-23 21:26 UTC (permalink / raw)
  To: Mike.Relyea@xerox.com; pgsql-odbc; +Cc: alexander.moore@accenture.com

Thanks Mike, 

This is vba for Word, not sure if that makes any difference. Just tried rewriting the query using querydefs (as demonstrated below), issued the bulk sql insert statement as strSql but am still receiving 3137 Missing semicolon (;) at end of SQL statement.


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.



-----Original Message-----
From: Relyea, Mike [mailto:Mike.Relyea@xerox.com] 
Sent: 22 June 2016 14:53
To: pgsql-odbc@postgresql.org
Cc: Machet, Daniel <daniel.machet@accenture.com>
Subject: RE: [ODBC] Issue with Save and Release points

>> 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

Daniel,

If this is an Access limitation, you may be able to work around it by creating a pass-through query to run your SQL.  I use this function to create a pass-through on the fly.  I then run the query and delete it when I'm done.

Function DefineQuery(strName As String, _
                    strConnect As String, _
                    intTimeout As Integer, _
                    strSql As String, _
                    boolReturnsRecords As Boolean _
                    )
'A function to create a query given the listed parameters On Error GoTo ErrorHandler Dim db As dao.Database Dim qrydef As dao.QueryDef Dim StsBar As Variant

Set db = CurrentDb

StsBar = SysCmd(acSysCmdSetStatus, "Defining the query...")

db.QueryDefs.Delete (strName) 'Delete the query first if it exists 'Create the query
create_query:
Set qrydef = db.CreateQueryDef(strName)
    qrydef.Connect = strConnect
    qrydef.ODBCTimeout = intTimeout
    qrydef.sql = strSql
    qrydef.ReturnsRecords = boolReturnsRecords

StsBar = SysCmd(acSysCmdClearStatus)
    
ErrorHandler:
Select Case Err.Number
    Case 0
        Err.Clear
    Case 2501
        Err.Clear
    Case 3125
        MsgBox "The query name " & strName & " is not valid.  Make sure it does not contain any punctuation and is not longer than 64 characters."
    Case 3141
        MsgBox "I couldn't define the query."
    Case 3265
        Err.Clear
        GoTo create_query
    Case 3151
        MsgBox "Connection to database was lost.  Please close and reopen this program."
    Case 3359
        MsgBox "I couldn't create the query properly.  Please close and reopen this program."
    Case Else
        Dim test As Variant
        Dim strCommand As String
        strCommand = "Define Query"
        test = EmailError(Err.Number, Err.Description, strCommand) End Select End Function


Mike

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc


^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Issue with Save and Release points
@ 2016-06-23 23:10  daniel.machet@accenture.com
  parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
  2 siblings, 0 replies; 16+ messages in thread

From: daniel.machet@accenture.com @ 2016-06-23 23:10 UTC (permalink / raw)
  To: h-inoue@dream.email.ne.jp; +Cc: tsunakawa.takay@jp.fujitsu.com; e.ratnakar.shetty@accenture.com; pgsql-odbc; alexander.moore@accenture.com

Hi Hiroshi,

You got me thinking i.e. for DAO etc and so I started checking how this relates to vba DAO and found an example for recordset as Dynaset using AddNew and Update which seems to have had a positive impact (taking about  a tenth of the time now which should do for us I reckon)… not sure on the policy for posting links – and have just been cc’d in on this mail so am not aware of where to go to mark your post as the correct solution (if you can forward me a url and advise whether I can share the link?)

Regards
Dan


________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.

Accenture means Accenture (UK) Limited (registered number 4757301), registered in England and Wales with registered address at 30 Fenchurch Street, London EC3M 3BD.


From: Inoue, Hiroshi [mailto:h-inoue@dream.email.ne.jp]
Sent: 22 June 2016 11:48
To: Machet, Daniel <daniel.machet@accenture.com>
Cc: tsunakawa.takay@jp.fujitsu.com; Ratnakar Shetty, E. <e.ratnakar.shetty@accenture.com>; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] Issue with Save and Release points

Hi Daniel,
On 2016/06/21 17:33, daniel.machet@accenture.com<mailto: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


^ permalink  raw  reply  [nested|flat] 16+ messages in thread


end of thread, other threads:[~2016-06-23 23:10 UTC | newest]

Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-06-16 16:21 Issue with Save and Release points e.ratnakar.shetty@accenture.com
2016-06-17 01:41 ` Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
2016-06-17 14:28   ` daniel.machet@accenture.com
2016-06-17 22:54     ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2016-06-19 21:43       ` daniel.machet@accenture.com
2016-06-19 23:17       ` daniel.machet@accenture.com
2016-06-20 08:38       ` daniel.machet@accenture.com
2016-06-20 13:32         ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2016-06-20 13:58           ` daniel.machet@accenture.com
2016-06-20 23:24             ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2016-06-21 08:33               ` daniel.machet@accenture.com
2016-06-22 10:48                 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2016-06-22 11:00                   ` daniel.machet@accenture.com
2016-06-22 13:53                   ` Relyea, Mike <Mike.Relyea@xerox.com>
2016-06-23 21:26                     ` daniel.machet@accenture.com
2016-06-23 23:10                   ` daniel.machet@accenture.com

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox