wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Assuming column name is ID #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Trying to load data into a table using manage.py loaddata in django

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

Please provide any additional information below.
The error 
: ibm_db_dbi::ProgrammingError: [IBM][CLI Driver][DB2/DARWIN] SQL0206N 
"ID" is not valid in the context where it is used.  SQLSTATE=42703 
SQLCODE=-206

In:
operations.py 
sequence_reset_sql (Line 171)

Original issue reported on code.google.com by hse...@gmail.com on 7 Dec 2009 at 8:58

GoogleCodeExporter commented 9 years ago
Are you mapping your database table to model by model's meta data. 
If yes, then you may didn't specify any model's field as primary_key . In this 
case
django adds “ID” as primary key attribute. And that “ID” field is not 
available on
your database table. So that you get this error.

So, either specify any model's field as primary key or adds a auto incremental 
integer column named 'ID'. 

Original comment by rahul.pr...@in.ibm.com on 20 Apr 2010 at 3:53

GoogleCodeExporter commented 9 years ago
Let me know above solution works for you or not.

Original comment by rahul.pr...@in.ibm.com on 20 Apr 2010 at 4:02

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 29 Apr 2010 at 12:36