use strict; use warnings; use Encode; use DBI; use Encode::HanExtra; #my $dbh = DBI->connect(qq(dbi:Oracle:Athenadb), qq(adas), qq(adas),{RaiseError => 1,oracharset => 'AL32UTF8'}); my $dbh = DBI->connect(qq(dbi:ADO:Provider=MSDAORA.1;Data Source=AthenaDB), qq(athena), qq(athena), {RaiseError => 1}); my $statment = "select ADAS_ID, ADAS_Name from ADAS_DEVICE"; my $sth = $dbh->prepare($statment) or die dbh->errstr; $sth->execute or die dbh->errstr; while (my ($ADAS_ID, $ADAS_NAME) = $sth->fetchrow_array) { $ADAS_NAME = encode ("gb18030", decode("utf8", $ADAS_NAME)); print "$ADAS_NAME ID is $ADAS_ID\n"; }