DBI + DBD::ODBC + unixODBC + FreeTDS + SQL Server error
- From: eric@xxxxxxxx
- Date: 26 May 2005 12:33:26 -0700
I have a Perl application which uses the DBI library to do it's
database work. The backend database is a SQL Server database that I am
communicating through unixODBC using the FreeTDS library as the ODBC
driver.
This application runs and works fine on the Windows platform. Basically
I am getting some kind of error message when executing a
selectall_arrayref statement.
DBI::db=HASH(0x878de94) trace level set to 8 in DBI 1.32-ithread
-> selectall_arrayref for DBD::ODBC::db
(DBI::db=HASH(0x878df9c)~0x878de94 ' SELECT "Key", Value FROM
UserProfile WHERE UserID = ? ' HASH(0x87ed968) '55') thr#804bc70
1 -> prepare for DBD::ODBC::db (DBI::db=HASH(0x878de94)~INNER '
SELECT "Key", Value FROM UserProfile WHERE UserID = ? '
HASH(0x87ed968)) thr#804bc70
dbih_setup_handle(DBI::st=HASH(0x876e9f0)=>DBI::st=HASH(0x87eda70),
DBD::ODBC::st, 878e1e8, Null!)
dbih_make_com(DBI::db=HASH(0x878de94), DBD::ODBC::st, 212)
thr#804bc70
dbih_setup_attrib(DBI::st=HASH(0x87eda70), Err,
DBI::db=HASH(0x878de94)) SCALAR(0x876ec0c) (already defined)
dbih_setup_attrib(DBI::st=HASH(0x87eda70), State,
DBI::db=HASH(0x878de94)) SCALAR(0x876ec54) (already defined)
dbih_setup_attrib(DBI::st=HASH(0x87eda70), Errstr,
DBI::db=HASH(0x878de94)) SCALAR(0x876ec30) (already defined)
dbih_setup_attrib(DBI::st=HASH(0x87eda70), Debug,
DBI::db=HASH(0x878de94)) 8 (already defined)
dbih_setup_attrib(DBI::st=HASH(0x87eda70), FetchHashKeyName,
DBI::db=HASH(0x878de94)) 'NAME' (already defined)
dbih_setup_attrib(DBI::st=HASH(0x87eda70), HandleError,
DBI::db=HASH(0x878de94)) undef (not defined)
initializing sth query timeout to 0
ignore named placeholders = 0
dbd_preparse scanned 1 distinct placeholders
SQLPrepare returned 0
dbd_st_prepare'd sql f142549208, ExecDirect=0
SELECT "Key", Value FROM UserProfile WHERE UserID = ?
1 <- prepare= DBI::st=HASH(0x876e9f0) at ../framework/Auth/User.pm
line 162 via ../framework/Data/DataObject.pm line 186
bind 1 <== '55' (attribs: ), type 0
dbd_st_execute (outparams = 0)...
bind 1 <== '55' (size 2/3/0, ptype 4, otype 1, sqltype 12)
bind 1 <== '55' (len 2/2, null 0)
bind 1: CTy=1, STy=VARCHAR, CD=80, Sc=0, VM=2.
SQLBindParameter: idx = 1: fParamType=1, name=1, fCtype=1, SQL_Type
= 12, cbColDef=80, scale=0, rgbValue = 87ed708, cbValueMax=2, cbValue =
2
Param value = 55
rebind check char Param 1 (55)
dbd_st_execute (for hstmt 142549208 before)...
dbd_st_execute (for hstmt 142549208 after, rc = -1)...
dbd_error: err_rc=-1 rc=0 s/d/e: 142549208/142142352/142140928
dbd_error: err_rc=-1 rc=0 s/d/e: 0/142142352/142140928
dbd_error: err_rc=-1 rc=0 s/d/e: 0/0/142140928
st_execute/SQLExecute error -1 recorded: (DBD: st_execute/SQLExecute
err=-1)
!! ERROR: -1 '(DBD: st_execute/SQLExecute err=-1)'
<- selectall_arrayref= undef at ../framework/Auth/User.pm line 162
via ../framework/Data/DataObject.pm line 186
DBD::ODBC::db selectall_arrayref failed: (DBD: st_execute/SQLExecute
err=-1) at ../framework/Auth/User.pm line 162.
-> DESTROY for DBD::ODBC::st (DBI::st=HASH(0x87eda70)~INNER)
thr#804bc70
SQLFreeStmt called, returned -1.
dbd_error: err_rc=-1 rc=0 s/d/e: 142549208/142142352/142140928
dbd_error: err_rc=-1 rc=0 s/d/e: 0/142142352/142140928
dbd_error: err_rc=-1 rc=0 s/d/e: 0/0/142140928
st_destroy/SQLFreeStmt(SQL_DROP) error -1 recorded: (DBD:
st_destroy/SQLFreeStmt(SQL_DROP) err=-1)
<- DESTROY= undef at ../framework/Auth/User.pm line 163
-> STORE for DBD::ODBC::db (DBI::db=HASH(0x878de94)~INNER
'TraceLevel' 0) thr#804bc70
DBD::ODBC unsupported attribute passed (TraceLevel)
STORE DBI::db=HASH(0x878de94) 'TraceLevel' => 0
<- STORE= 1 at ../framework/Auth/User.pm line 163 via
.../framework/Data/DataObject.pm line 186
As you can see it is getting an error when calling the ODBC function
SQLExecute but it doesn't output what the problem it. Only that there
is a problem. I tried reducing the problem to a simple script that just
connects to the database, executes the query and prints the result to
the command line. When I do that it works fine. But within the
application I get the above behavior. Is there anyway I can get more
information about what the actual error message is?
Any help is greatly appreciated. I have spent most of the day examining
the DBD-ODBC library and I can't quite figure out what my problem is.
The ODBC connection seems fine (by the fact that isql and my simple
test script work fine). The application should be fairly fine because
it runs under Windows. I just can't isolate the problem.
Eric
.
- Follow-Ups:
- Prev by Date: Re: SQL Problems : No suitable driver
- Next by Date: Compiling Multiple versions of DBD::Oracle
- Previous by thread: Oracle 9i RAC on Linux
- Next by thread: Re: DBI + DBD::ODBC + unixODBC + FreeTDS + SQL Server error
- Index(es):
Relevant Pages
|