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 183: Insert into Nullable DateTimeField failed
2 people starred this issue and may be notified of changes. Back to list
Status:  NoFix
Owner:  ----
Closed:  Jul 2011


 
Reported by nbma...@gmail.com, Jun 20, 2011
What steps will reproduce the problem?
1. Create a model field with models.DateTimeField(null = True, blank = True)
2. Pass None as a value for this field
3. it failed on .save() (see the traceback below)

What is the expected output? What do you see instead?
NULL value should be inserted.

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

Django: 1.3.0 final
Python: Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32
Windows: Windows 7 Professional SP1
SQL Server: SQL Server 2005
pyodbc: pyodbc-2.1.7-py2.6
django-pyodbc: pyodbc-2.1.8.win32-py2.6.exe


Please provide any additional information below.

Traceback (most recent call last):
  File "C:\Test\test_insert.py", line 65, in <module>
    lead.save()
  File "C:\Python26\lib\site-packages\django\db\models\base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "C:\Python26\lib\site-packages\django\db\models\base.py", line 553, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "C:\Python26\lib\site-packages\django\db\models\manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "C:\Python26\lib\site-packages\django\db\models\query.py", line 1436, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 791, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "C:\Python26\lib\site-packages\django\db\backends\util.py", line 34, in execute
    return self.cursor.execute(sql, params)
  File "C:\Python26\lib\site-packages\sql_server\pyodbc\base.py", line 318, in execute
    return self.cursor.execute(sql, params)
pyodbc.Error: ('07009', '[07009] [Microsoft][SQL Native Client]Invalid Descriptor Index (0) (SQLDescribeParam); [07009]
[Microsoft][SQL Native Client]Invalid parameter number (0)')


Jun 20, 2011
#1 nbma...@gmail.com
Sorry, wrong project. I have re-posted it in django-pyodbc.

Jul 9, 2011
Project Member #2 mkleehammer
(No comment was entered for this change.)
Status: NoFix

Powered by Google Project Hosting