#! c:\perl\bin\perl.exe -W use DBI; use strict; use CGI qw(:standard); use CGI::Carp; my $to_all_account; my @array_account; print header(); my $sql = " SELECT MASTERTABLE.ACCOUNT# FROM TEST.MASTERTABLE WHERE (MASTERTABLE.NUMBER LIKE '%1324940%') AND (MASTERTABLE.SERIAL = 'FF' OR MASTERTABLE.SERIAL = 'CC' OR MASTERTABLE.SERIAL = 'OO' OR MASTERTABLE.SERIAL = 'NN') "; #Connetcting to an AS400 Database using ODBC, is it secure? my $user = "MYUSER"; my $pass = "MYPASS"; my $dbh = DBI->connect("DBI:ODBC:MYDB",$user, $pass) || print "Connect to MYDB fail: $!"; my $sth = $dbh->prepare($sql); $sth->execute() || die $sth->errstr; while ( $to_all_account = $sth->fetchrow_arrayref) { print "
^^^^^^^^@{$to_all_account}^^^^^
\n"; push (@array_account,@{$to_all_account}); } print "
**@array_claim**
\n"; }