Re: ORA-01790 error on union all with nullable bind variables

Doug Henderson <[email protected]> Fri, 29 Apr 2016 12:17:26 -0600
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAJ1FpuNvroLYx58oh0vjcF164hpMSu7ZbcKJaT3A1B6x26cH1g@mail.gmail.com>
Cast :arg0 to a numeric type.

... select cast(:argo) as number ...
On Apr 18, 2016 1:50 AM, "Mikhail Nacharov" <[email protected]> wrote:

Hello everyone!

Does anybody know why this query fails with ORA-01790?

```
>>> import cx_Oracle
>>> con = cx_Oracle.connect('django/[email protected]/orcl')
>>> cur = con.cursor()
>>> cur.execute('SELECT 1 FROM dual UNION ALL SELECT :arg0 FROM dual',
arg0=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: ORA-01790: expression must have same datatype
as corresponding expression
```

It seems to me that bind variables passes as empty string '' and not as
NULL value.
Moreover, when I execute this query in oracle sqldeveloper I had the
same exception. Is it some oracle "feature"?

P.S.: The purpose of this question is the bug in django:
https://code.djangoproject.com/ticket/22669


--
Mikhail <[email protected]>



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers
of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users