ArmandoG has asked for the wisdom of the Perl Monks concerning the following question:
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 exact ---------------------------------------------------------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()) { 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(); }
This givesme a list of the data that I needmy $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" }
but did not work can someone give me an Idea? thanksmy $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); $dbh->func( 'cars', 'CSV', 'testperl.csv', 'ad_catalog'); my $sth = $dbh->prepare("SELECT * FROM cars WHERE PAT =@row->[0]"); $sth->execute();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question of SQL and an array
by moritz (Cardinal) on Nov 27, 2007 at 16:01 UTC | |
by ArmandoG (Sexton) on Nov 27, 2007 at 16:40 UTC | |
|
Re: Question of SQL and an array
by Anonymous Monk on Nov 27, 2007 at 16:04 UTC | |
|
Re: Question of SQL and an array
by jZed (Prior) on Nov 27, 2007 at 17:44 UTC | |
by ArmandoG (Sexton) on Nov 27, 2007 at 18:25 UTC | |
by jZed (Prior) on Nov 27, 2007 at 18:38 UTC | |
|
Re: Question of SQL and an array
by chrism01 (Friar) on Nov 28, 2007 at 01:03 UTC | |
by ArmandoG (Sexton) on Nov 28, 2007 at 17:14 UTC |