in reply to Re^8: SQL query using elements from array
in thread SQL query using elements from array
poj#!perl use strict; use DBI; my $dbh = dbh(); my $sql ="select * from information_schema.columns where table_name = ?"; my @tables = ('TopsData.dbo.AUDT_AuditChrt','TopsData.dbo.AUDT_AuditMe +dication'); for my $table (@tables){ my $ar = $dbh->selectall_arrayref($sql,undef,$table); for (@$ar){ print join ":",@$_,"\n"; } } # connect sub dbh { my $dsn = "dbi:ODBC:DSN=TEST-DB1"; my $dbh = DBI->connect($dsn, 'SA', 'pass', {RaiseError => 1, PrintError => 1}) or die (Error connecting " $DBI::errstr"); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^10: SQL query using elements from array
by AllPaoTeam (Sexton) on Oct 15, 2014 at 15:42 UTC | |
by poj (Abbot) on Oct 15, 2014 at 15:56 UTC | |
by AllPaoTeam (Sexton) on Oct 29, 2014 at 00:10 UTC | |
by mje (Curate) on Oct 29, 2014 at 11:57 UTC | |
by poj (Abbot) on Oct 29, 2014 at 12:22 UTC | |
|