I'm being told by a Java programmer that use of the bind_param method on a statement handler is more efficient than calling execute with the parameters. He thinks that if I don't use bind_param that Perl does the binding instead of allowing Oracle to do it and so Oracle has to parse two different statements that don't match if I execute it twice. True? False?
Update: And the answer is: false. He checked in the database. He sounded mildly surprised.
Nevermind
runrig on 2006-08-08T19:05:54
I'm wrong:
The "bind_param" method takes a copy of $bind_value and associates...You're binding a copy of the value, not the variable itself (like with bind_columns). I'm way off.
Re:Nevermind
Matts on 2006-08-08T21:35:13
Yeah, plus internally the DBD implementations do all this work in C, they don't tend to have much access to the perl level.
It's also worth noting that this is entirely DBD driver dependent. I believe old versions of the MySQL DBD used to bind the variables into the string sent to the database because MySQL had no bind param support (it does now, IIRC).