(Fwd) DBI support for executing SQL scripts

From: Tim Bunce (Tim.Bunce_at_pobox.com)
Date: 03/25/05


Date: Fri, 25 Mar 2005 20:47:27 +0000
To: dbi-users@perl.org


----- Forwarded message from Qaseem Shaikh <qaseemshaikh@yahoo.com> -----

Delivered-To: tim.bunce@pobox.com
X-SPF-Guess: pass (seems reasonable for qaseemshaikh@yahoo.com to mail through 206.190.38.248)
Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Date: Thu, 24 Mar 2005 16:59:09 -0800 (PST)
From: Qaseem Shaikh <qaseemshaikh@yahoo.com>
Subject: DBI support for executing SQL scripts
To: Tim.Bunce@pobox.com

Hi

I have been looking for ways to run .sql files on a
MySQl database via DBI. And I guess I've hit the wall.
I believe that do(), prepare()+execute() would only
execute pure sql. I don't want to parse the sql files
and run each statement separately because those files
would contain:

a. statements such as "use DatabaseX"
b. various other characters such as --(are
autogenerated by some tool)

These files could be easily run by doing
a. source on the mysql promt
b. mysql DatabaseX < file.sql on the command prompt

Would you pls suggest something here? Your help would
be greatly appreciated.

Thanks,
Qaseem

                
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

----- End forwarded message -----