Dale --  Ok --

I'm using a "fixed" version of DBI 1.21 (which shouldn't affect the issues,
but just in case, I thought I'd let you know.  The preparse stuff had a
problem that was failing the tests and crashing.  I'm not seeing that
behavior here).

I tried with the older version and the newer version and you are right .. I
see the same problem(s).

I did find one problem in your script, where you are looking for the column
'wid', instead of ID.  Minor, but that might account for the uninitialized
value warning.  It might also be a result of setting up the test... so, it
may not be the problem either...

Now for the meat of the issue.  I can get around the problem by using
bind_param(1, $uValue, DBI::SQL_VARCHAR) then execute with no parameters.
Or, at the top of the script after the connect set the default bind type to
SQL_VARCHAR...  I don't like it, though!  It seems that the SQLDescribeParam
is failing during the second query, but the actual parameter is
recognized...I can work around this, but it seems to be a bug to me.  What I
can do is: if SQLDescribeParam fails, set back to SQL_VARCHAR.  That will
'hide' the error, but I do think it's a bug in their driver...of course I
can be wrong, but it does seem strange to me.  I think .41 will have a
workaround -- but as I said, it will only hide the real problem.

Attached is my version of your script, with the mods to avoid the error...

Jeff





> -----Original Message-----
> From: Dale Couch [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 15, 2002 10:54 AM
> To: [EMAIL PROTECTED]
> Subject: RE: :ODBC, Datetime strings and placeholders
>
>
> Jeff,
>
> Okay, I think I have what you asked for.
>
> Attached is a revised version of my script that is self contained, it
> creates the tables and then demonstrates the error and then drops the
> tables.
>
> Also attached is the level 9 trace file.
>
> Thanks
>
> Dale
>
>
> >From: "Jeff Urlwin" <[EMAIL PROTECTED]>
> >To: "Dale Couch" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> >Subject: RE: :ODBC, Datetime strings and placeholders
> >Date: Mon, 15 Apr 2002 10:07:48 -0400
> >
> >Dale -- Hmmm... is there a way you can send me the output of
> trace level 9?
> >Just stick this at the top of the code: DBI->trace(9,"c:/lev9.txt")
> >
> >I believe the problem you are seeing is that DBD::ODBC is trying, now, to
> >determine the bind type whereas in .39 it defaulted to VARCHAR.
> >
> >If you could, a small test case with data would be VERY helpful.
>  I.e, near
> >the top of the script:
> >     eval {
> >             $dbh->do("Drop table blah");
> >             $dbh->do("drop table blah2");
> >             $dbh->do("Create table blah");
> >             $dbh->do("Create table blah2");
> >             $dbh->do("insert into etc");
> >     };
> >
> >Then, I can actually use this as a test case for the future.
> >
> >Also, what version of DBI are you using?
> >
> >Thanks,
> >
> >Jeff
> >
> > > -----Original Message-----
> > > From: Dale Couch [mailto:[EMAIL PROTECTED]]
> > > Sent: Sunday, April 14, 2002 4:05 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: :ODBC, Datetime strings and placeholders
> > >
> > >
> > > Jeff,
> > >
> > > I just installed DBD::ODBC 0.40 and I have encounter an oddity and a
> > > problem with placeholders.  I have been running 0.38 up to this point.
> > >
> > > Attached is my test script.  There are 2 separate sample SQL
> statements,
> > > they should return the same answer, but have been written using 2
> > > different
> > > syntaxes.
> > >
> > > The first one use a FROM clause joining 2 tables, the other uses an
> >INNER
> > > JOIN.  The one that uses the FROM clause works fine under 0.40, the
> >INNER
> > > JOIN version gives the following error.
> > >
> > > DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server
> Driver]Invalid
> > > parameter number (SQL-S1093)
> > > [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
> > > (SQL-S1002)(DBD:
> > > _rebind_ph/SQLDescribeParam err=-1) at c:\temp\testodbc.pl line 35.
> > > DBD::ODBC::st fetchrow_hashref failed: (DBD: no select statement
> > > currently
> > > executing err=-1) at c:\temp\testodbc.pl line 36.
> > >
> > > I tried to drop back to 0.39 and it works like 0.38 did, so this
> > > problem is
> > > new to 0.40.
> > >
> > > The other oddity that I ran into is if you change the $uValue to
> > > be a true
> > > number, I get the following error.
> > >
> > > Use of uninitialized value in print at c:\temp\testodbc.pl line 22.
> > >
> > > I do not have a print statement in my code at that line, so my
> > > guess is that
> > > something in DBD::ODBC or DBI is causing the problem, or I am missing
> > > something obvious.  This is a problem in 0.38, 0.39 and 0.40.
> > >
> > > I am running perl v5.6.1 built for MSWin32-x86-multi-thread,
> build 631.
> > > DBI 1.21
> > > Windows XP, MDAC 2.7+ (the version delivered with VS.NET)
> > > against SQL Server 2000 no service packs.
> > >
> > > the word column is of type VARCHAR if that makes a difference.
> > >
> > > Any insight into these 2 issues would be appreciated.
> > >
> > > Thanks
> > >
> > > Dale
> > >
> > > _________________________________________________________________
> > > Join the world�s largest e-mail service with MSN Hotmail.
> > > http://www.hotmail.com
> > >
> >
> >
>
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.

Attachment: testodbc.pl
Description: Binary data

Reply via email to