Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

dg4odbc to MySQL update errors: "does not support IS NULL in this context"

787961Aug 4 2010 — edited Aug 5 2010
I am having a problem with 'where x is null' clauses in update statements to MySQL from 11g, using dg4odbc. Updates using the clause 'where x is null' return errors like this:

ORA-02070: database PLAZAHOST does not support IS NULL in this context

The rejected queries never get to mysql. Furthermore, I noticed that select statements with 'where x is null' show up in the mysql query log with the where clause stripped out, although correct results are returned to SQLPlus. It looks as though 'where x is null' is stripped off by dg4odbc, which subsequently applies a secondary filter to the results received from MySQL.

Note, both statements above work properly when issued from the MySQL client.

Has anybody seen this? It's a big problem for me, but I can't find any references to other people having the same problem, so I assume I've got something misconfigured -- but I don't know what.

I'm using MySQL ODBC 5.1 Driver, MySQL 5.1 Community Edition, and Oracle 11g R1 all running on a 32-bit Windows server.

Thank you -- rick

=============
here's a spool of a sample oracle session:


SQL> col descr1 for a40
SQL> select * from t1@plazahost;

id1 descr1
---------- ----------------------------------------
1 hello
2

SQL> descr t1@plazahost
Name Null? Type
----------------------------------------- -------- ----------------------------
id1 NUMBER(10)
descr1 VARCHAR2(255)

SQL> select * from t1@plazahost where "descr1" is null;

id1 descr1
---------- ----------------------------------------
2

SQL> update t1@plazahost set "descr1"='updated' where "descr1" is null;
update t1@plazahost set "descr1"='updated' where "descr1" is null
*
ERROR at line 1:
ORA-02070: database PLAZAHOST does not support IS NULL in this context


SQL> spool off


=============
here's the mysql query log snip for the oracle session:

100804 10:24:20 1637 Connect moms_oracle@MOMS_HOST on moms
1637 Query SET NAMES utf8
1637 Query SET character_set_results = NULL
1637 Query SET SQL_AUTO_IS_NULL = 0
1637 Query set autocommit=0
1637 Query select database()
1637 Query COMMIT
1637 Query SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
1637 Query SHOW TABLE STATUS FROM `moms` LIKE 'T1'
1637 Query SHOW COLUMNS FROM `moms`.`t1`
1637 Query SELECT `id1`,`descr1` FROM `moms`.`t1` LIMIT 0
1637 Query SHOW KEYS FROM `moms`.`T1`
1637 Query SHOW TABLE STATUS FROM `moms` LIKE 'T1'
1637 Query SHOW COLUMNS FROM `moms`.`t1`
1637 Query SELECT `id1`,`descr1` FROM `moms`.`t1` LIMIT 0
1637 Query SELECT A1.`id1`,A1.`descr1` FROM `T1` A1
1637 Query SELECT `id1`,`descr1` FROM `T1`
100804 10:24:28 1637 Query COMMIT
1637 Quit



=============
here's the Oracle HS trace file for the same oracle session:

Oracle Corporation --- WEDNESDAY AUG 04 2010 10:24:19.608

Heterogeneous Agent Release
11.1.0.7.0

Oracle Corporation --- WEDNESDAY AUG 04 2010 10:24:19.608
Version 11.1.0.7.0

Entered hgogprd
HOSGIP for "HS_FDS_TRACE_LEVEL" returned "DEBUG"
Entered hgosdip
setting HS_OPEN_CURSORS to default of 50
setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"
setting HS_FDS_RECOVERY_PWD to default value
setting HS_FDS_TRANSACTION_LOG to default of "HS_TRANSACTION_LOG"
setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"
setting HS_NLS_NCHAR to default of "UCS2"
setting HS_FDS_TIMESTAMP_AS_DATE to default of "TRUE"
setting HS_RPC_FETCH_REBLOCKING to default of "ON"
setting HS_FDS_FETCH_ROWS to default of "100"
setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"
setting HS_FDS_PROC_IS_FUNC to default of "FALSE"
setting HS_FDS_CHARACTER_SEMANTICS to default of "FALSE"
setting HS_FDS_MAP_NCHAR to default of "TRUE"
setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"
setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"
setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"
setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"
setting HS_FDS_QUERY_DRIVER to default of "TRUE"
setting HS_FDS_SUPPORT_STATISTICS to default of "TRUE"
Parameter HS_FDS_QUOTE_IDENTIFIER is not set
setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw$:SQLProcedures;gtw$:SQLStatistics"
Exiting hgosdip, rc=0
ORACLE_SID is "plazahost"
Product-Info:
Port Rls/Upd:7/0 PrdStat:0
Agent:Oracle Database Gateway for ODBC
Facility:hsa
Class:ODBC, ClassVsn:11.1.0.7.0_0006, Instance:plazahost
Exiting hgogprd, rc=0
Entered hgoinit
HOCXU_COMP_CSET=1
HOCXU_DRV_CSET=178
HOCXU_DRV_NCHAR=1000
HOCXU_DB_CSET=178
HOCXU_SEM_VER=110000
Entered hgolofn at 2010/08/04-10:24:19
Exiting hgolofn, rc=0 at 2010/08/04-10:24:20
HOSGIP for "HS_OPEN_CURSORS" returned "50"
HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
Exiting hgoinit, rc=0 at 2010/08/04-10:24:20
Entered hgolgon at 2010/08/04-10:24:20
reco:0, name:moms_oracle, tflag:0
Entered hgosuec at 2010/08/04-10:24:20
Exiting hgosuec, rc=0 at 2010/08/04-10:24:20
HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
HOSGIP for "HS_FDS_TRANSACTION_LOG" returned ""HS_TRANSACTION_LOG""
HOSGIP for "HS_FDS_TIMESTAMP_AS_DATE" returned "TRUE"
HOSGIP for "HS_FDS_CHARACTER_SEMANTICS" returned "FALSE"
HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
HOSGIP for "HS_FDS_RESULT_SET_SUPPORT" returned "FALSE"
HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
using moms_oracle as default value for "HS_FDS_DEFAULT_OWNER"
HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
Entered hgocont at 2010/08/04-10:24:20
HS_FDS_CONNECT_INFO = "momsPlazaHost"
RC=-1 from HOSGIP for "HS_FDS_CONNECT_STRING"
Entered hgogenconstr at 2010/08/04-10:24:20
dsn:momsPlazaHost, name:moms_oracle
optn:
##>Connect Parameters (len=43)<##
## DSN=momsPlazaHost;
#! UID=moms_oracle;
#! PWD=*
Exiting hgogenconstr, rc=0 at 2010/08/04-10:24:20
DriverName:myodbc5.dll, DriverVer:05.01.0005
DBMS Name:MySQL, DBMS Version:5.1.35-community-log
Exiting hgocont, rc=0 at 2010/08/04-10:24:20
SQLGetInfo returns Y for SQL_CATALOG_NAME
SQLGetInfo returns 64 for SQL_MAX_CATALOG_NAME_LEN
Exiting hgolgon, rc=0 at 2010/08/04-10:24:20
Entered hgoulcp at 2010/08/04-10:24:20
Entered hgowlst at 2010/08/04-10:24:20
Exiting hgowlst, rc=0 at 2010/08/04-10:24:20
SQLGetInfo returns ` for SQL_IDENTIFIER_QUOTE_CHAR
SQLGetInfo returns Y for SQL_COLUMN_ALIAS
2 instance capabilities will be uploaded
capno:1991, context:0x0001ffff, add-info: 0
capno:1992, context:0x0001ffff, add-info: 1, translation:"`"
Exiting hgoulcp, rc=0 at 2010/08/04-10:24:20
Entered hgouldt at 2010/08/04-10:24:20
0 instance DD translations were uploaded
Exiting hgouldt, rc=0 at 2010/08/04-10:24:20
Entered hgobegn at 2010/08/04-10:24:20
tflag:0 , initial:1
hoi:0x12f03c, ttid (len 26) is ...
00: 4D4F4D53 44422E38 62393537 3032392E [MOMSDB.8b957029.]
10: 322E3130 2E333131 3531 [2.10.31151]
tbid (len 23) is ...
00: 4D4F4D53 44425B32 2E31302E 33313135 [MOMSDB[2.10.3115]
10: 315D5B31 2E345D [1][1.4]]
TXN Capable:3, Isolation Option:0xf
Exiting hgobegn, rc=0 at 2010/08/04-10:24:20
Entered hgodtab at 2010/08/04-10:24:20
count:1
table: T1
Entered hgopcda at 2010/08/04-10:24:20
Column:1(id1): dtype:4 (INTEGER), prc/scl:10/0, nullbl:1, octet:0, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/08/04-10:24:20
Entered hgopcda at 2010/08/04-10:24:20
Column:2(descr1): dtype:12 (VARCHAR), prc/scl:255/0, nullbl:1, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/08/04-10:24:20
The hoada for table T1 follows...
hgodtab, line 651: Printing hoada @ 02A32DDC
MAX:2, ACTUAL:2, BRC:1, WHT=6 (TABLE_DESCRIBE)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 id1
12 VARCHAR Y 255 255 0/ 0 0 0 0 descr1
Exiting hgodtab, rc=0 at 2010/08/04-10:24:20
Entered hgodafr, cursor id 0 at 2010/08/04-10:24:20
Exiting hgodafr, rc=0 at 2010/08/04-10:24:20
Entered hgotcis at 2010/08/04-10:24:20
Calling SQLStatistics for T1
Calling SQLColumns for moms_oracle.T1
Column "id1": dtype=4, colsize=10, decdig=0, char_octet_length=0, cumulative avg row len=4
Column "descr1": dtype=12, colsize=255, decdig=0, char_octet_length=255, cumulative avg row len=195
Exiting hgotcis, rc=0 at 2010/08/04-10:24:20
Entered hgopars, cursor id 1 at 2010/08/04-10:24:20
type:0
SQL text from hgopars, id=1, len=40 ...
00: 53454C45 43542041 312E6069 6431602C [SELECT A1.`id1`,]
10: 41312E60 64657363 72316020 46524F4D [A1.`descr1` FROM]
20: 20605431 60204131 [ `T1` A1]
Exiting hgopars, rc=0 at 2010/08/04-10:24:20
Entered hgoopen, cursor id 1 at 2010/08/04-10:24:20
hgoopen, line 83: NO hoada to print
Exiting hgoopen, rc=0 at 2010/08/04-10:24:20
Entered hgodscr, cursor id 1 at 2010/08/04-10:24:20
Entered hgopcda at 2010/08/04-10:24:20
Column:1(id1): dtype:4 (INTEGER), prc/scl:10/0, nullbl:1, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/08/04-10:24:20
Entered hgopcda at 2010/08/04-10:24:20
Column:2(descr1): dtype:12 (VARCHAR), prc/scl:255/0, nullbl:1, octet:256, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/08/04-10:24:20
hgodscr, line 506: Printing hoada @ 02A32DDC
MAX:2, ACTUAL:2, BRC:100, WHT=5 (SELECT_LIST)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 id1
12 VARCHAR Y 256 256 0/ 0 0 0 0 descr1
Exiting hgodscr, rc=0 at 2010/08/04-10:24:21
Entered hgoftch, cursor id 1 at 2010/08/04-10:24:21
hgoftch, line 117: Printing hoada @ 02A32DDC
MAX:2, ACTUAL:2, BRC:100, WHT=5 (SELECT_LIST)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 id1
12 VARCHAR Y 256 256 0/ 0 0 0 0 descr1
SQLBindCol: column 1, cdatatype: -16, bflsz: 4
SQLBindCol: column 2, cdatatype: 1, bflsz: 257
2 rows fetched
Exiting hgoftch, rc=0 at 2010/08/04-10:24:21
Entered hgoftch, cursor id 1 at 2010/08/04-10:24:21
hgoftch, line 117: Printing hoada @ 02A32DDC
MAX:2, ACTUAL:2, BRC:2, WHT=5 (SELECT_LIST)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 id1
12 VARCHAR Y 5 256 0/ 0 0 0 0 descr1
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/08/04-10:24:21
Entered hgoclse, cursor id 1 at 2010/08/04-10:24:23
Exiting hgoclse, rc=0 at 2010/08/04-10:24:23
Entered hgodafr, cursor id 1 at 2010/08/04-10:24:23
Exiting hgodafr, rc=0 at 2010/08/04-10:24:23
Entered hgopars, cursor id 1 at 2010/08/04-10:24:23
type:0
SQL text from hgopars, id=1, len=31 ...
00: 53454C45 43542060 69643160 2C606465 [SELECT `id1`,`de]
10: 73637231 60204652 4F4D2060 543160 [scr1` FROM `T1`]
Exiting hgopars, rc=0 at 2010/08/04-10:24:23
Entered hgoopen, cursor id 1 at 2010/08/04-10:24:23
hgoopen, line 83: NO hoada to print
Exiting hgoopen, rc=0 at 2010/08/04-10:24:23
Entered hgodscr, cursor id 1 at 2010/08/04-10:24:23
Entered hgopcda at 2010/08/04-10:24:23
Column:1(id1): dtype:4 (INTEGER), prc/scl:10/0, nullbl:1, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/08/04-10:24:23
Entered hgopcda at 2010/08/04-10:24:23
Column:2(descr1): dtype:12 (VARCHAR), prc/scl:255/0, nullbl:1, octet:256, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/08/04-10:24:23
hgodscr, line 506: Printing hoada @ 02A32DDC
MAX:2, ACTUAL:2, BRC:100, WHT=5 (SELECT_LIST)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 id1
12 VARCHAR Y 256 256 0/ 0 0 0 0 descr1
Exiting hgodscr, rc=0 at 2010/08/04-10:24:24
Entered hgoftch, cursor id 1 at 2010/08/04-10:24:24
hgoftch, line 117: Printing hoada @ 02A32DDC
MAX:2, ACTUAL:2, BRC:100, WHT=5 (SELECT_LIST)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 id1
12 VARCHAR Y 256 256 0/ 0 0 0 0 descr1
SQLBindCol: column 1, cdatatype: -16, bflsz: 4
SQLBindCol: column 2, cdatatype: 1, bflsz: 257
2 rows fetched
Exiting hgoftch, rc=0 at 2010/08/04-10:24:24
Entered hgoftch, cursor id 1 at 2010/08/04-10:24:24
hgoftch, line 117: Printing hoada @ 02A32DDC
MAX:2, ACTUAL:2, BRC:2, WHT=5 (SELECT_LIST)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 id1
12 VARCHAR Y 5 256 0/ 0 0 0 0 descr1
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/08/04-10:24:24
Entered hgoclse, cursor id 1 at 2010/08/04-10:24:27
Exiting hgoclse, rc=0 at 2010/08/04-10:24:27
Entered hgodafr, cursor id 1 at 2010/08/04-10:24:27
Exiting hgodafr, rc=0 at 2010/08/04-10:24:27
Entered hgocomm at 2010/08/04-10:24:28
keepinfo:0, tflag:1
00: 4D4F4D53 44422E38 62393537 3032392E [MOMSDB.8b957029.]
10: 322E3130 2E333131 3531 [2.10.31151]
tbid (len 23) is ...
00: 4D4F4D53 44425B32 2E31302E 33313135 [MOMSDB[2.10.3115]
10: 315D5B31 2E345D [1][1.4]]
cmt(0):
Entered hgocpctx at 2010/08/04-10:24:28
Exiting hgocpctx, rc=0 at 2010/08/04-10:24:28
Exiting hgocomm, rc=0 at 2010/08/04-10:24:28
Entered hgolgof at 2010/08/04-10:24:28
tflag:1
Exiting hgolgof, rc=0 at 2010/08/04-10:24:28
Entered hgoexit at 2010/08/04-10:24:28
Exiting hgoexit, rc=0 at 2010/08/04-10:24:28
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2010
Added on Aug 4 2010
1 comment
1,426 views