in reply to Re: Question of SQL and an array
in thread Question of SQL and an array
so far so good, at this point I have @row->[0] that has all the data from the field PAT of the table PATENTES.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"; }
Hope this is more exactmy $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()) { my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); $dbh->func( 'cars', 'CSV', 'testperl.csv', 'ad_catalog'); my $sth = $dbh->prepare("SELECT * INTO OUTFILE @row->[0].csv FROM ca +rs WHERE pat = @row->[0]); $sth->execute(); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Question of SQL and an array
by jZed (Prior) on Nov 27, 2007 at 18:38 UTC |