And giving me this error message:#!?usr/bin/perl -w use DBI; my $dbh = DBI->connect("DBI:mysql:database=proyecto;host=localhost", "root", "xyz123", {'RaiseError' => 1}); my $sth = $dbh->prepare("SELECT PAT FROM patentes"); $sth->execute(); while ((my @row) = $sth->fetchrow_array()) { print "$row[0]\n"; my $a_dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); $a_dbh->func( 'cars', 'CSV', 'testperl.csv', 'ad_catalog'); my $a_sth = $a_dbh->prepare("SELECT * INTO OUTFILE $row[0].csv FROM +cars WHERE pat = $row[0]"); $a_sth->execute(); }
can you help me please? thank youSQL ERROR: Bad table or column name 'INTO' is a SQL reserved word! DBD::AnyData::db prepare failed: SQL ERROR: Bad table or column name ' +INTO' is a SQL reserved word! [for Statement "SELECT * INTO OUTFILE 0447.csv FROM cars WHERE pat = +0447"] at finaltest.pl line 16. DBD::AnyData::db prepare failed: SQL ERROR: Bad table or column name ' +INTO' is a SQL reserved word! [for Statement "SELECT * INTO OUTFILE 0447.csv FROM cars WHERE pat = +0447"] at finaltest.pl line 16.
In reply to Re^2: Question of SQL and an array
by ArmandoG
in thread Question of SQL and an array
by ArmandoG
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |