Abi,

I'm having trouble reproducing your errors here.  I am testing against MS
SQL Server 2000 and I get the correct functionality in my test case.  I'm
about to release DBD::ODBC 0.33_3 (I just released _2 for another problem
about 3 hours ago), which has a new test for multiple result sets.  Can you
please
        a) Send me a description of your configuraiton.  It seems that you are
using OpenLink drivers, so yours may be more complex than others...
        b) try the new version and let me know how the tests go.

It *may* be a bug in DBD::ODBC, but I'm leaning towards it being an issue
with your configuration/drivers.  I am, of course, only testing on SQL
Server 2000 for this (neither Oracle nor Access support it) and I can be
wrong :)

Thanks,

Jeff

> -----Original Message-----
> From: Abi Pothen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 29, 2002 3:49 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Multiple Results in DBD::ODBC 0.31
>
>
> Jeff,
> Thank you for the reply. I am attaching herewith 3 files.
> output.err, output.txt, program.pl
> Thanks,
> Abi.
>
>
> output.err
> ==========
>     DBI 1.20-nothread dispatch trace level set to 4
>     Note: perl is running without the recommended perl -w option
>     ->
> DBI->connect(dbi:ODBC:DSN=TESTDB;Database=xxxxx;uid=usrxxxxx;pwd=xxxxx, ,
> ****, HASH(0x14b6d8))
>     -> DBI->install_driver(ODBC) for solaris perl=5.00404 pid=29412
> ruid=1007 euid=1007
>        install_driver: DBD::ODBC version 0.31 loaded from
> blib/lib/DBD/ODBC.pm
>     New DBI::dr (for DBD::ODBC::dr, parent=, id=)
>     dbih_setup_handle(DBI::dr=HASH(0x17b194)=>DBI::dr=HASH(0x1d1594),
> DBD::ODBC::dr, 0, Null!)
>     dbih_make_com(Null!, DBD::ODBC::dr, 92)
>     <- install_driver= DBI::dr=HASH(0x17b194)
>     -> default_user in DBD::_::dr for DBD::ODBC::dr
> (DBI::dr=HASH(0x17b194)~0x1d1594 undef undef HASH(0x14b690))
>     <- default_user= ( undef undef ) [2 items] at DBI.pm line 422
>     -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x17b194)~0x1d1594
> 'DSN=TESTDB;Database=xxxxx;uid=usrxxxxx;pwd=xxxxx' undef ****
> HASH(0x14b690))
>     New DBI::db (for DBD::ODBC::db, parent=DBI::dr=HASH(0x1d1594), id=)
>     dbih_setup_handle(DBI::db=HASH(0x1d14f8)=>DBI::db=HASH(0x1d1480),
> DBD::ODBC::db, 172fa4, Null!)
>     dbih_make_com(DBI::dr=HASH(0x1d1594), DBD::ODBC::db, 116)
> Driver connect 'DSN=TESTDB;Database=xxxxx;uid=usrxxxxx;pwd=xxxxx', '', ''
>     <- connect= DBI::db=HASH(0x1d14f8) at DBI.pm line 425
>     -> STORE for DBD::ODBC::db (DBI::db=HASH(0x1d1480)~INNER
> 'RaiseError' 1)
>     STORE DBI::db=HASH(0x1d1480) 'RaiseError' => 1
>     <- STORE= 1 at DBI.pm line 450
>     -> STORE for DBD::ODBC::db (DBI::db=HASH(0x1d1480)~INNER
> 'PrintError' 1)
>     STORE DBI::db=HASH(0x1d1480) 'PrintError' => 1
>     <- STORE= 1 at DBI.pm line 450
>     -> STORE for DBD::ODBC::db (DBI::db=HASH(0x1d1480)~INNER
> 'AutoCommit' 1)
>     <- STORE= 1 at DBI.pm line 450
>     <- connect= DBI::db=HASH(0x1d14f8)
>     -> prepare for DBD::ODBC::db (DBI::db=HASH(0x1d14f8)~0x1d1480 'select
> emp_id, emp_name, address1, address2 from employee where emp_id = 2
>            select emp_id from employee where emp_id = 2')
>     New DBI::st (for DBD::ODBC::st, parent=DBI::db=HASH(0x1d1480), id=)
>     dbih_setup_handle(DBI::st=HASH(0x1d1504)=>DBI::st=HASH(0x14b6cc),
> DBD::ODBC::st, 1d1510, Null!)
>     dbih_make_com(DBI::db=HASH(0x1d1480), DBD::ODBC::st, 196)
>     dbd_st_prepare'd sql f1913992
>       select emp_id, emp_name, address1, address2 from employee
> where emp_id = 2
>            select emp_id from employee where emp_id = 2
>     <- prepare= ( DBI::st=HASH(0x1d1504) ) [1 items] at x.pl line 15
>     -> execute for DBD::ODBC::st (DBI::st=HASH(0x1d1504)~0x14b6cc)
>     dbd_st_execute (outparams = 0)...
>     dbd_st_execute (for hstmt 1913992 before)...
>     dbd_describe sql 1913992: num_fields=4
>       col  1: INTEGER  len=  4 disp= 12, prec= 10 scale=0
>       col  2: VARCHAR  len= 36 disp= 36, prec= 35 scale=0
>       col  3: VARCHAR  len= 36 disp= 36, prec= 35 scale=0
>       col  4: VARCHAR  len= 36 disp= 36, prec= 35 scale=0
>       col  1: 'emp_id' sqltype=INTEGER, ctype=SQL_C_CHAR, maxlen=12
>       col  2: 'emp_name' sqltype=VARCHAR, ctype=SQL_C_CHAR, maxlen=36
>       col  3: 'address1' sqltype=VARCHAR, ctype=SQL_C_CHAR, maxlen=36
>       col  4: 'address2' sqltype=VARCHAR, ctype=SQL_C_CHAR, maxlen=36
>     <- execute= -1 at x.pl line 16
>     -> errstr in DBD::_::common for DBD::ODBC::st
> (DBI::st=HASH(0x1d1504)~0x14b6cc)
>     <- errstr= undef at x.pl line 17
>     -> fetchrow_arrayref for DBD::ODBC::st
> (DBI::st=HASH(0x1d1504)~0x14b6cc)
>        SQLFetch rc 0
>     dbih_setup_fbav for 4 fields => 0x1d151c
> fetch num_fields=4
> fetch col#0 emp_id datalen=1 displ=12
> fetch col#1 emp_name datalen=13 displ=36
> fetch col#2 address1 datalen=11 displ=36
> fetch col#3 address2 datalen=13 displ=36
>     <- fetchrow_arrayref= [ '2' 'Albert Ringer' 'New & Brews' '577 First
> St.' ] row1 at x.pl line 22
>     -> fetchrow_arrayref for DBD::ODBC::st
> (DBI::st=HASH(0x1d1504)~0x14b6cc)
>        SQLFetch rc 100
>        SQLGetFunctions - supported: 1
>     dbd_describe sql 1913992: num_fields=1
>       col  1: INTEGER  len=  4 disp= 12, prec= 10 scale=0
>       col  1: 'emp_id' sqltype=INTEGER, ctype=SQL_C_CHAR, maxlen=12
>     <- fetchrow_arrayref= undef row1 at x.pl line 23
>     -> FETCH for DBD::ODBC::st (DBI::st=HASH(0x14b6cc)~INNER
> 'odbc_more_results')
>     <- FETCH= 1 at x.pl line 22
>     -> fetchrow_arrayref for DBD::ODBC::st
> (DBI::st=HASH(0x1d1504)~0x14b6cc)
>        SQLFetch rc -1
> dbd_error: err_rc=-1 rc=0 s/d/e: 1913992/1912968/1385480
> dbd_error: SQL-S1002 (native 0): [OpenLink][ODBC][Driver]Invalid column
> number (SQL-S1002)
> dbd_error: err_rc=-1 rc=0 s/d/e: 0/1912968/1385480
> dbd_error: err_rc=-1 rc=0 s/d/e: 0/0/1385480
>     ERROR EVENT -1 '[OpenLink][ODBC][Driver]Invalid column number
> (SQL-S1002)(DBD: st_fetch/SQLFetch err=-1)' on DBI::st=HASH(0x14b6cc)
> st_fetch/SQLFetch error -1 recorded:
> [OpenLink][ODBC][Driver]Invalid column
> number (SQL-S1002)(DBD: st_fetch/SQLFetch err=-1)
>     !! ERROR: -1 '[OpenLink][ODBC][Driver]Invalid column number
> (SQL-S1002)(DBD: st_fetch/SQLFetch err=-1)'
>     <- fetchrow_arrayref= undef row1 at x.pl line 22
> DBD::ODBC::st fetchrow_arrayref failed: [OpenLink][ODBC][Driver]Invalid
> column number (SQL-S1002)(DBD: st_fetch/SQLFetch err=-1) at x.pl line 22.
> DBD::ODBC::st fetchrow_arrayref failed: [OpenLink][ODBC][Driver]Invalid
> column number (SQL-S1002)(DBD: st_fetch/SQLFetch err=-1) at x.pl line 22.
>     <> DESTROY ignored for outer handle DBI::st=HASH(0x1d1504) (inner
> DBI::st=HASH(0x14b6cc))
>     -> DESTROY for DBD::ODBC::st (DBI::st=HASH(0x14b6cc)~INNER)
>     <- DESTROY= undef
>     dbih_clearcom 0x1d1504 (com 0x1d9008, type 3) done.
>
>     <> DESTROY ignored for outer handle DBI::db=HASH(0x1d14f8) (inner
> DBI::db=HASH(0x1d1480))
>     -> DESTROY for DBD::ODBC::db (DBI::db=HASH(0x1d1480)~INNER)
>     <- DESTROY= undef
>     dbih_clearcom 0x1d14f8 (com 0x1d2788, type 2) done.
>
>     -- DBI::END
>     -> disconnect_all for DBD::ODBC::dr (DBI::dr=HASH(0x17b194)~0x1d1594)
>     <- disconnect_all= '' at DBI.pm line 467
>     -> DESTROY in DBD::_::common for DBD::ODBC::dr
> (DBI::dr=HASH(0x1d1594)~INNER)
>     <- DESTROY= undef during global destruction
>     dbih_clearcom 0x17b194 (com 0x182d08, type 1) done.
>
>     <> DESTROY for DBI::dr=HASH(0x17b194) ignored (inner handle gone)
>
>
> >From: "Jeff Urlwin" <[EMAIL PROTECTED]>
> >To: "Abi Pothen" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> >CC: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> >Subject: RE: Multiple Results in DBD::ODBC 0.31
> >Date: Tue, 29 Jan 2002 03:21:03 -0500
> >
> >Can you please turn on tracing and send me the trace file for the
> >statement(s) that fail?
> >
> >Thanks,
> >
> >Jeff
> >
> > > -----Original Message-----
> > > From: Abi Pothen [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, January 28, 2002 8:02 PM
> > > To: [EMAIL PROTECTED]
> > > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: Multiple Results in DBD::ODBC 0.31
> > >
> > >
> > > Hi,
> > >   I am having a problem with DBD::ODBC (version 0.31) that
> has fixes to
> > > handle multiple result set. This fix is working fine only when
> > > the number of
> > > columns of the previous result set is equal to or greater than
> > > the number of
> > > columns of the following result set. If the number of columns of
> > > the result
> > > set of the previous result set is greater than the following, SQLFetch
> > > function call is failing and returning -1.
> > >
> > > Error message is:
> > > DBD::ODBC::st fetchrow_arrayref failed:
> [OpenLink][ODBC][Driver]Invalid
> > > column number (SQL-S1002)(DBD: st_fetch/SQLFetch err=-1)
> > >
> > > Can somebody please suggest a solution for this problem ?
> > >
> > > Your help will be greatly appreciated.
> > >
> > > Sample sql statements used:
> > >
> > >
> > > a.  "select emp_name, address1, address2 from employee where
> > > emp_id   = 2 "
> > >       select emp_id from employee where  emp_id   = 2"
> -- Failing
> > > with message ( SQLFetch = -1 )
> > >
> > >
> > > b.   " select emp_id from employee where  emp_id   = 2
> > >        select emp_name, address1, address2 from employee where
> > > emp_id   =
> > > 2" -- Executes succefully
> > >
> > >
> > >
> > >
> > >
> > > _________________________________________________________________
> > > Join the world�s largest e-mail service with MSN Hotmail.
> > > http://www.hotmail.com
> > >
> > >
> >
>
>
> _________________________________________________________________
> Join the world�s largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>

Reply via email to