Dear Monks
Yesterday I post a question regarding a problem in my code when I try to do an Insert
This is the link to last post
The help was good but I still can't understand it, and well did not run as well.
The original code was like this :
my $dbhX1 = DBI->connect('dbi:XBase(RaiseError=1):');
my $select1 = $dbhX1->prepare("SELECT * FROM r501");
$select1->execute();
print "\nEjecutar SELECT de r501\n";
my $mysql_dbh1 = DBI->connect("DBI:mysql:database=$datafilename;ho
+st=localhost",
"root", "xyz123",
{'RaiseError' => 1});
while ( (my @row) = $select1 -> fetchrow_array() ){
my $sthsql = $mysql_dbh1->prepare ("INSERT INTO r501 (reg, pat, ped,
+ adnasec, impexp, cveped, adnaent, crupimp, rfcimp, curpaa)
VALUES ($row[0], $row[1], $row[2]
+, $row[3], $row[4], $row[5], $row[6], $row[7], $row[8], $row[9]")
$sthsql->execute();
}
I trim the amount of the data being inserted but still a viable example.
I hope someone can explain it a little bit more with an example, sorry if these is to much work, I really like perl has help me do things that would take a lot of time doing in something else, it just that I did not get it .
Thank you !