On Mon, 10 Jun 2002 22:24:50 +0300 Hytham Shehab <[EMAIL PROTECTED]> wrote:

>     but what is the difference between do, and prepare then execute?
> i mean i know that they both accomplish the same task, but i want to know
> when is the appropriate time to use one of them, and the appropriate
> time to
> use the other.

Use do() if you only expect to execute a non-SELECT SQL once.  It's not as
useful for SELECT because do() doesn't return a handle for fetching with,
one of the select_*() methods would be more useful then.

You only need to prepare() a statement once and can execute() it as many
times as necessary.  This is especially nice if you can use placeholders to
vary the values being used.

It's all in the fine manual, run 'perldoc DBI' to read it.

If you are changing the topic, please change the subject.
-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.




Reply via email to