Oeschey, Lars (I/ET-83, extern) wrote:
Hi,

I have a script, that I have to migrate from a MSSQL-DB to Oracle. before I 
used an ODBC connection to the MSSQL, so I just changed that ODBC connection. 
Everything *should* work as before, but it doesn't. I don't get data from the 
Oracle DB. Here's the facts:

connect:

my $msdbh = DBI->connect("dbi:ODBC:LABELPRINT", "user", "password", { RaiseError => 1, PrintError 
=> 1, AutoCommit => 1 } ) or do {&myError ("$DBI::errstr");};

Select:

my $mssth=$msdbh->prepare("SELECT SPEDITION,KEP FROM $speditionen");
$mssth->execute;
my $rh_speditionen=$mssth->fetchall_hashref('SPEDITION');
print Dumper $rh_speditionen;

that is the exact same code as used with the MSSQL, but it doesn't work 
anymore... where could I else check for the problem?

I made a ODBC Log, but don't understand it too well... (there's a connect error 
in the beginning for example, but afterwards the select works?)

Your fetch did not return any rows - see below:

------ODBC LOG----------------------------------------------------------



perl -w labelpr 11f8-1614 ENTER SQLPrepare HSTMT 02801EA8
                UCHAR *             0x022B5644 [      44] "SELECT SPEDITION,KEP FROM 
LABELPRINT_SPED_IN"
                SDWORD                    44

this is the sql you issued.


perl -w labelpr 11f8-1614       EXIT  SQLPrepare  with return code 0 
(SQL_SUCCESS)
                HSTMT               02801EA8
                UCHAR *             0x022B5644 [      44] "SELECT SPEDITION,KEP FROM 
LABELPRINT_SPED_IN"
                SDWORD                    44

and the driver accepted it ok.

perl -w labelpr 11f8-1614 ENTER SQLExecute HSTMT 02801EA8

perl -w labelpr 11f8-1614       EXIT  SQLExecute  with return code 0 
(SQL_SUCCESS)
                HSTMT               02801EA8

sql now executed

perl -w labelpr 11f8-1614 ENTER SQLRowCount HSTMT 02801EA8
                SQLLEN *            0x022B5170

perl -w labelpr 11f8-1614       EXIT  SQLRowCount  with return code 0 
(SQL_SUCCESS)
                HSTMT               02801EA8
                SQLLEN *            0x022B5170 (-1)

perl -w labelpr 11f8-1614 ENTER SQLNumResultCols HSTMT 02801EA8
                SWORD *             0x0140FBB6

perl -w labelpr 11f8-1614       EXIT  SQLNumResultCols  with return code 0 
(SQL_SUCCESS)
                HSTMT               02801EA8
                SWORD *             0x0140FBB6 (2)


2 columns in result set

various removed.


perl -w labelpr 11f8-1614 ENTER SQLFetch HSTMT 02801EA8

perl -w labelpr 11f8-1614       EXIT  SQLFetch  with return code 100 
(SQL_NO_DATA_FOUND)
                HSTMT               02801EA8

no data in result set. i.e., you select returned no rows.

perl -w labelpr 11f8-1614 ENTER SQLMoreResults HSTMT 02801EA8

perl -w labelpr 11f8-1614       EXIT  SQLMoreResults  with return code 100 
(SQL_NO_DATA_FOUND)
                HSTMT               02801EA8


There are no errors because no errors have occurred. You need to run your SQL to the database directly and check what you get. Are you in the schema you expected?

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

Reply via email to