From: Bill Seitz [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 02, 2001 1:17 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: problem using ODBC cursor.description with sql View?
Argh, you are correct. I have one Text field. I changed my query to set the order of fields explicitly, and found that if I left that as the last field in the query it worked fine, but anywhere else resulted in the specified error message.
These sort of platform-level bugs are horrifying. Does anyone know which ODBC library doesn't have this bug, or what the plan is for fixing it in the core library? (I'm afraid I don't have the chops to contribute to such an effort...)
-----Original Message-----
From: Wade Leftwich [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 26, 2001 5:25 PM
To: Bill Seitz; [EMAIL PROTECTED]
Subject: RE: problem using ODBC cursor.description with sql View?
If any of the fields are of Text type, they have to come last in your query.
I believe that's the error message you get from the old-style ODBC lib used
by mxODBC, and maybe by others, when this condition is not met.Regarding getting the fieldnames -- mxODBC doesn't support it, but I'm
pretty sure the ODBC driver in the win32 package (ActiveState distro) does.As far as the ODBC driver is concerned, view == table.
To troubleshoot this, you should probably just get a db connection from a
Python prompt and run each query there.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Bill
> Seitz
> Sent: Tuesday, June 26, 2001 4:21 PM
> To: [EMAIL PROTECTED]
> Subject: problem using ODBC cursor.description with sql View?
>
>
> I'm writing ASP page that uses a generic ODBC driver to query
> MsSql2K. Have some generic code that grabs both an array of the
> resultSet, plus an array of fieldNames (cursor Description).
> When I run this code against a view (which just does a pretty
> simple join: have queried the view fine in MsSqlQueryAnalyzer), I
> get an error message about SQL select Failed - "select * from
> timechargesAsHours" - [Microsoft][ODBC SQL Server Driver]Invalid
> Descriptor Index in FETCH In stepping through the code
> interactively, I find the problem occurs at the cursor.fetchall()
> call. Is there a problem getting cursor descriptions via ODBC?
> Or is there an inherent problem in using a cursor against a view?
> Does a cursor require a unique key, which a view lacks?