Many thanks for your replies. I think the reason for prepare is the
statement handle on return so it can be passed adcross with subroutine
calls. Passing a statement handle is less memory intensive than passing
the SQL around. Please correct me if I am wrong.
You are wrong. A statement handle is a fundamental part of the DBI
abtraction, regardless of whether this makes passing them to subroutines
more memory efficient or not. How do you call execute one a statement
handle which does not exist? How do you bind parameters to a statemnet
handle which does not exist? How do you bind columns to a statement handle
that does not exist? How do you avoid excessive soft parses (in Oracle,
and I presume other databases) without statement handles? How do you fetch
rows one at a time without statement handles? (Well, I guess you could
make a result_set handle instead of a statement handle for that last one.)
Xho