Prepare Method

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lunr
Posts: 5
Joined: Mon 04 Dec 2006 13:08

Prepare Method

Post by lunr » Thu 07 Dec 2006 09:48

hi, i am using odac 5.80.0.37 for Delphi7.
In help page of TCustomDADataSet.Prepare it is written 'TCustomDADataSet automatically prepares a query if it is executed without first being executed', but when i use TOraQuery.Execute i don't see any Prepare statements sent to Oracle in DBMonitor. Is it possible that a Prepare statement is sent which is not displayed in DBMonitor?
And i would like to know if you would advice to use Prepare when using ODAC with Oracle 10g.
Thank you.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 07 Dec 2006 15:49

Implicit preparation of dataset is not reflected in DBMonitor. We advice you to use explicit preparation of dataset when you are going to execute a SQL statement multiple times. In most cases this improves performance.

lunr
Posts: 5
Joined: Mon 04 Dec 2006 13:08

Post by lunr » Fri 08 Dec 2006 08:42

Implicit preparation of dataset is not reflected in DBMonitor.
So i guess implicit preparation consists of an prepare statement sent to database. I have some network problems, so I want to avoid roundtrips as much as i can. And I thought 'prepare's maybe unnecessary since maybe Oracle handles this.
May setting Options.KeepPrepared := true be a solution for me?

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Tue 12 Dec 2006 15:45

This can help you if you execute a statement several times. If KeepPrepared is True, after the first execution the query stays prepared, so on the next execution impict preparation is not performed.

Post Reply