My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 129: Exception when passing an untyped NULL as a param
2 people starred this issue and may be notified of changes. Back to list
Status:  Complete
Owner:  ----
Closed:  Nov 2010


 
Reported by tjgolden@gmail.com, Oct 19, 2010
What steps will reproduce the problem?

import pyodbc
db = pyodbc.connect ("...")
q = db.cursor ()
q.execute ("SELECT ?", [None])
q.fetchall ()

What is the expected output? What do you see instead?

Expected: [(None,)]

Instead: pyodbc.Error: ('07009', '[07009] [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (0) (SQLDescribeParam); [42000] [Micros
oft][ODBC SQL Server Driver]Syntax error or access violation (0)')

What version of the product are you using? On what operating system?

pyodbc 2.1.8 (strictly: a git clone) on Python 2.6 WinXP SP3 against MSSQL 2005

Please provide any additional information below.

This is a regression; the code used to work in pyodbc 2.0.x. The problem occurs when SQLDescribeParam is called within GetParamType in params.cpp. This is presumably because SQL Server can't determine a type for the parameter. 

The error code is unfortunately a fairly general one which would cover circumstances other than this so it's not possible simply to filter it out at this point. (Altho' the code does work if you ignore the error and return VARCHAR).
Nov 21, 2010
Project Member #1 mkleehammer
Fixed in 2.1.9-beta03

Status: Complete
Labels: Python2

Powered by Google Project Hosting