Выполнил хранимую процедуру вручную, которая извлекает 45 записей, где, выполняя ее с помощью сценария ниже perl, я получил $ results "-1". Поэтому я включил установить DBI TRACE = 1. Найдите ниже журнал трассировки. Как решить эту проблему?
Платформа : Windows База данных : MS SQL SERVER Perl Версия : 5.24
Программа: -
use strict;
use DBI;
use DBD::ODBC;
use Data::Dump qw(pp)
print "Connecting\n";
my $server_name = "XXXXXXXX";
my $server_port = 'NNNN';
my $database_name = 'XXXXX';
my $database_user = 'XX';
my $database_pass = 'XXXXX';
my $dbh = DBI->connect("dbi:ODBC:DSN=sql_test", $database_user, $datab
+ase_pass)
|| die "Couldn't open database: $DBI::errstr\n";
my $sql = $dbh->prepare("Exec sp_listUsers '25329601','1'") or die "ba
+d prepare $!";
my $results = $sql->execute();
pp $results;
Журнал: -
DBI 1.636-ithread default trace level set to 0x0/1 (pid 11108 pi 7c2ff
+4) at
DBI.pm line 296 via test_dbi.pl line 2
Trying to connect
-> DBI->connect(dbi:ODBC:DSN=sql_test, **, ****)
-> DBI->install_driver(ODBC) for MSWin32 perl=5.024000 pid=11108 r
+uid=0 euid
=0
install_driver: DBD::ODBC version 1.52 loaded from C:/Perl/lib/
+DBD/ODBC.pm
<- install_driver= DBI::dr=HASH(0x1d76c6c)
!! The warn '0' was CLEARED by call to connect method
<- connect('DSN=sql_test', '**', ...)= ( DBI::db=HASH(0x22ec33c) )
+ [1 items] at DBI.pm line 684
info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change
+d database context to 'master'. (SQL-01000)
[Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin
+g to us_english. (SQL-01000)' (err#0)
<- STORE('PrintError', 1)= ( 1 ) [1 items] at DBI.pm line 736
info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change
+d database context to 'master'. (SQL-01000)
[Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin
+g to us_english. (SQL-01000)' (err#0)
<- STORE('AutoCommit', 1)= ( 1 ) [1 items] at DBI.pm line 736
info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change
+d database
context to 'master'. (SQL-01000)
[Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin
+g to us_en
glish. (SQL-01000)' (err#0)
<- STORE('Username', '**')= ( 1 ) [1 items] at DBI.pm line 739
info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change
+d database
context to 'master'. (SQL-01000)
[Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin
+g to us_english. (SQL-01000)' (err#0)
<- connected('dbi:ODBC:DSN=sql_test', '**', ...)= ( undef ) [1 ite
+ms] at DBI.pm line 746
<- connect= DBI::db=HASH(0x22ec33c)
info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change
+d database context to 'master'. (SQL-01000)
[Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin
+g to us_english. (SQL-01000)' (err#0)
<- STORE('dbi_connect_closure', CODE(0x1d6e5ac))= ( 1 ) [1 items]
+at DBI.pmline 755
!! The info '''' was CLEARED by call to prepare method
<- prepare('Exec sp_listUsers '25329601','1'')= ( DBI::st=HASH(0x2
+2e969c) ) [1 items] at test_dbi.pl line 16
<- execute= ( -1 ) [1 items] at test_dbi.pl line 18
-1
<- DESTROY(DBI::st=HASH(0x22e9504))= ( undef ) [1 items] at test_d
+bi.pl line 20
!! The info '''' was CLEARED by call to disconnect_all method
<- disconnect_all= ( '' ) [1 items] at DBI.pm line 763
()! <- DESTROY(DBI::dr=HASH(0x1d76c6c))= ( undef ) [1 items] during
+global destruction
! <- DESTROY(DBI::db=HASH(0x22ec264))= ( undef ) [1 items] during gl
+obal destruction