Django, Informix, ibm_db and DB2 data server driver -
i'm trying connect ids(v11.50) django(v1.3.1) using ibm db2 data server driver (odbc)(v10.1) , ibm_db (https://code.google.com/p/ibm-db/). simple query 'select distinct adm_audit.action adm_audit' django driver transfers select distinct "adm_audit"."action" "adm_audit"
, generate error:
[ibm][cli driver][ids/unix64] syntax error has occurred.
i tried execute same sql statement in db2cli, , returns same error:
>select distinct "adm_audit"."action" "adm_audit" select distinct "adm_audit"."action" "adm_audit" sqlerror: rc = 0 (sql_success) sqlgetdiagrec: sqlstate : 42000 fnativeerror : -201 szerrormsg : [ibm][cli driver][ids/unix64] syntax error has occurred. cberrormsg : 58
if quotes removed, statement completes successfully:
> select distinct adm_audit.action adm_audit select distinct adm_audit.action adm_audit fetchall: columns: 1 action ...results... fetchall: 13 rows fetched.
anu suggestions? appreciate help.
problem solved.
1) delimident variable
2) change ibm_db_django -> operation.py around 176 line, string
"name = upper( name )"
to
"name = lower( name )"
(and import `lower' string class)
there environment variable delimident
can control usage of double quotes. set y
use around delimited sql identifiers.
more info: http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls1077.htm
i tested odbc , jdbc , works same, select * "aaa"
:
- without
delimident
set, defaultdelimident=n
: error - with
delimident=y
set: query works
Comments
Post a Comment