Hello all,

I'm trying to 'source' a mysql script file from inside of perl and I'm 
having problems. The mysql script file is called load.sql.20011231, and it's 
full of insert statements. Here a small sample:

insert into crontabs values
(' ', 'dev2', 'asn', '00', '19', 'ALL', 'ALL', '1');
insert into crontabs values
(' ', 'dev2', 'asn', '00', '19', 'ALL', 'ALL', '2');

Here is the perl code that I'm using to try to execute the sourcing of this 
file:

$connection2 = DBI->connect("DBI:mysql:$database", $user, $message) || die 
"Cannot connect to $database";
$load_sql = "source ${CRONLIST_SQL}/load.sql.${file_date}";
$cursor2 = $connection2->prepare($load_sql) or die "Can't prepare $load_sql: 
$connection2->errstr\n";
$cursor2->execute;
$rc2 = $cursor2->finish;
$rc2 = $connection2->disconnect;

Here is the error that I'm getting when trying to run this:

DBD::mysql::st execute failed: You have an error in your SQL syntax near 
'source /home/cronlist/sql/load.sql.20011231' at line 1 at
/home/cronlist/bin/crontab_load.pl line 74.

Any ideas as to how to get around this?

Thanks!

-Stephen Spalding


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to