why is ora_check_sql only a prepare attribute?
am 06.08.2007 11:01:28 von Martin.Evans
I'm always looking to speed up my perl/DBI operations and noticed in
DBD::Oracle ora_check_sql which is described under "prepare attributes" as:
If 1 (default), force SELECT statements to be described in prepare(). If
0, allow SELECT statements to defer describe until execute().
Why is this only a prepare attribute? It would be much more useful if it
could be set on the database handle and be inherited by statement
handles as this would avoid having to set it on every prepare. As it
stands I think it is no use to me unless I change every single prepare
and then also run the risk of another DBD throwing my prepares out when
they don't recognise the attribute whereas if it was on the database
handle I could easily set it per DBD.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
Re: why is ora_check_sql only a prepare attribute?
am 06.08.2007 15:41:56 von Tim.Bunce
On Mon, Aug 06, 2007 at 10:01:28AM +0100, Martin Evans wrote:
> I'm always looking to speed up my perl/DBI operations and noticed in
> DBD::Oracle ora_check_sql which is described under "prepare attributes" as:
>
> If 1 (default), force SELECT statements to be described in prepare(). If
> 0, allow SELECT statements to defer describe until execute().
>
> Why is this only a prepare attribute?
No good reason that I can remember. There is this comment in the code
/* ora_check_sql only works for selects owing to Oracle behaviour */
which may hint at the original reason.
> It would be much more useful if it
> could be set on the database handle and be inherited by statement
> handles as this would avoid having to set it on every prepare. As it
> stands I think it is no use to me unless I change every single prepare
Probably easy to patch.
> and then also run the risk of another DBD throwing my prepares out when
> they don't recognise the attribute whereas if it was on the database
> handle I could easily set it per DBD.
The 'ora_' prefix ensures that other drivers should ignore it.
Tim.