- 论坛徽章:
- 0
|
在执行pl脚本的时候,报一下错误:
[dss@HADOOP-ETL1 ~]$ perl connect_hive.pl
650
set_err: state ('652') is not a 5 character string, using 'S1000' instead at connect_hive.pl line 6.
DBD::ODBC::st execute failed: 523 650 (SQL-652) at connect_hive.pl line 6.
脚本内容如下:
use DBI;
my $dbh = DBI->connect("dbi:ODBC:HiveServer2",'dss','dss@2017',{AutoCommit > 0,PrintError > 0,RaiseError > 0,} ) or die $DBI::errstr;
my $sth = $dbh->prepare("select id from default.ymtest");
$sth->execute();
while(@row_ary=$sth->fetchrow_array)
{
my $i=0;
while($i < @row_ary)
{
print "@row_ary[$i]|@|";
$i++;
}
print "\n";
}
$sth->finish;
$dbh->disconnect();
如果把查询表换做一张不存在的表,就会报表不存在的错误??
补充:这台机器上mysql可以通过这种方式查到数据。
查了很多资料,希望大神指导一下。
PS:同样这个脚本在别的机器上可执行。
|
|