Page 1 of 1

Prepare Method

Posted: Thu 07 Dec 2006 09:48
by lunr
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.

Posted: Thu 07 Dec 2006 15:49
by Challenger
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.

Posted: Fri 08 Dec 2006 08:42
by lunr
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?

Posted: Tue 12 Dec 2006 15:45
by Challenger
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.