Re: How do you use Aliases?

Jay <[email protected]> Tue, 9 Jun 2015 15:50:56 -0600
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CAJsMCEizrhox3PZ1fG-qMgXzkSKX=inPVQjeqq4cs_bC+4PkNg@mail.gmail.com>
Yes,

     It also results in "cx_Oracle.DatabaseError: ORA-00923: FROM keyword
not found where expected"

     I know when I run the command from plsql, or perl, I can quote the
Alias "UID" and the query works as expected. But I've tried every way I can
find on the Internet of quoting a string to Oracle with Python, and none of
it seems to work. for some reason, python just refuses to pass that string
to Oracle as a quoted value it would seem.

-= Jay =-


On Tue, Jun 9, 2015 at 3:27 PM, Fawcett, David (MNIT) <
[email protected]> wrote:

>  Have you tried
>
>
>
> 'SELECT EMPLID AS UID FROM TABLE WHERE EMPLID=:emplid'
>
>
>
> *From:* Jay [mailto:[email protected]]
> *Sent:* Tuesday, June 09, 2015 3:49 PM
> *To:* cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> *Subject:* [cx-oracle-users] How do you use Aliases?
>
>
>
> Trying to use an alias with cx_Oracle and nothing I'm trying seems to work:
>
>
>
> cursor.execute('SELECT EMPLID "UID" FROM TABLE WHERE EMPLID=:emplid',
> {'emplid':'123456'}):
>
>
>
> fails with:
>
>
>
> cx_Oracle.DatabaseError: ORA-00923: FROM keyword not found where expected
>
>
>
> I've tried every way I can find on the internets to quote/insert that
> Alias, but nothing seems to work. All I'm trying to do is alias EMPLID as
> UID.
>
>
>
> Is this just something that can't be done with this driver?? or Python?
> or??
>
>
>
> -= Jay =-
>
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> cx-oracle-users mailing list
> cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
>

------------------------------------------------------------------------------

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