%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyc

�
��4]c@@s?dZddlmZddlZddlZddlZddlZddlmZ	ddlm
Z
ddlmZddlmZd	d
lm
Z
d	dlmZd	dlmZd	d
lmZd	dlmZd	dlmZdejfd��YZdejfd��YZdefd��YZdee	jfd��YZdee	jfd��YZdefd��YZdej fd��YZ!dej"fd��YZ#d e	j$fd!��YZ%d"ej&fd#��YZ'd$e	j(fd%��YZ)d&ej*fd'��YZ+d(ej,fd)��YZ-d*e	j.fd+��YZ/d,ej0fd-��YZ1d.ej2fd/��YZ3d0ej4fd1��YZ5d2e	j6fd3��YZ7d4e	j8fd5��YZ9d6e	j:fd7��YZ;d8e
fd9��YZ<d:efd;��YZ=d<ej>fd=��YZ?d>efd?��YZ@e@ZAdS(@s0
.. dialect:: oracle+cx_oracle
    :name: cx-Oracle
    :dbapi: cx_oracle
    :connectstring: oracle+cx_oracle://user:pass@host:port/dbname[?key=value&key=value...]
    :url: https://oracle.github.io/python-cx_Oracle/

Additional Connect Arguments
----------------------------

When connecting with the ``dbname`` URL token present, the ``hostname``,
``port``, and ``dbname`` tokens are converted to a TNS name using the
``cx_Oracle.makedsn()`` function. The URL below::

    e = create_engine("oracle+cx_oracle://user:pass@hostname/dbname")

Will be used to create the DSN as follows::

    >>> import cx_Oracle
    >>> cx_Oracle.makedsn("hostname", 1521, sid="dbname")
    '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))(CONNECT_DATA=(SID=dbname)))'

The ``service_name`` parameter, also consumed by ``cx_Oracle.makedsn()``, may
be specified in the URL query string, e.g. ``?service_name=my_service``.

If ``dbname`` is not present, then the value of ``hostname`` in the
URL is used directly as the DSN passed to ``cx_Oracle.connect()``.

Additional connection arguments may be sent to the ``cx_Oracle.connect()``
function using the :paramref:`.create_engine.connect_args` dictionary.
Any cx_Oracle parameter value and/or constant may be passed, such as::

    import cx_Oracle
    e = create_engine(
        "oracle+cx_oracle://user:pass@dsn",
        connect_args={
            "mode": cx_Oracle.SYSDBA,
            "events": True
        }
    )

Alternatively, most cx_Oracle DBAPI arguments can also be encoded as strings
within the URL, which includes parameters such as ``mode``, ``purity``,
``events``, ``threaded``, and others::

    e = create_engine(
        "oracle+cx_oracle://user:pass@dsn?mode=SYSDBA&events=true")

.. versionchanged:: 1.3 the cx_oracle dialect now accepts all argument names
   within the URL string itself, to be passed to the cx_Oracle DBAPI.   As
   was the case earlier but not correctly documented, the
   :paramref:`.create_engine.connect_args` parameter also accepts all
   cx_Oracle DBAPI connect arguments.

There are also options that are consumed by the SQLAlchemy cx_oracle dialect
itself.  These options are always passed directly to :func:`.create_engine`,
such as::

    e = create_engine(
        "oracle+cx_oracle://user:pass@dsn", coerce_to_unicode=False)

The parameters accepted by the cx_oracle dialect are as follows:

* ``arraysize`` - set the cx_oracle.arraysize value on cursors, defaulted
  to 50.  This setting is significant with cx_Oracle as the contents of LOB
  objects are only readable within a "live" row (e.g. within a batch of
  50 rows).

* ``auto_convert_lobs`` - defaults to True; See :ref:`cx_oracle_lob`.

* ``coerce_to_unicode`` - see :ref:`cx_oracle_unicode` for detail.

* ``coerce_to_decimal`` - see :ref:`cx_oracle_numeric` for detail.

.. _cx_oracle_unicode:

Unicode
-------

The cx_Oracle DBAPI as of version 5 fully supports Unicode, and has the
ability to return string results as Python Unicode objects natively.

Explicit Unicode support is available by using the :class:`.Unicode` datatype
with SQLAlchemy Core expression language, as well as the :class:`.UnicodeText`
datatype.  These types correspond to the  VARCHAR2 and CLOB Oracle datatypes by
default.   When using these datatypes with Unicode data, it is expected that
the Oracle database is configured with a Unicode-aware character set, as well
as that the ``NLS_LANG`` environment variable is set appropriately, so that
the VARCHAR2 and CLOB datatypes can accommodate the data.

In the case that the Oracle database is not configured with a Unicode character
set, the two options are to use the :class:`.oracle.NCHAR` and
:class:`.oracle.NCLOB` datatypes explicitly, or to pass the flag
``use_nchar_for_unicode=True`` to :func:`.create_engine`, which will cause the
SQLAlchemy dialect to use NCHAR/NCLOB for the :class:`.Unicode` /
:class:`.UnicodeText` datatypes instead of VARCHAR/CLOB.

.. versionchanged:: 1.3  The :class:`.Unicode` and :class:`.UnicodeText`
   datatypes now correspond to the ``VARCHAR2`` and ``CLOB`` Oracle datatypes
   unless the ``use_nchar_for_unicode=True`` is passed to the dialect
   when :func:`.create_engine` is called.

When result sets are fetched that include strings, under Python 3 the cx_Oracle
DBAPI returns all strings as Python Unicode objects, since Python 3 only has a
Unicode string type.  This occurs for data fetched from datatypes such as
VARCHAR2, CHAR, CLOB, NCHAR, NCLOB, etc.  In order to provide cross-
compatibility under Python 2, the SQLAlchemy cx_Oracle dialect will add
Unicode-conversion to string data under Python 2 as well.  Historically, this
made use of converters that were supplied by cx_Oracle but were found to be
non-performant; SQLAlchemy's own converters are used for the string to Unicode
conversion under Python 2.  To disable the Python 2 Unicode conversion for
VARCHAR2, CHAR, and CLOB, the flag ``coerce_to_unicode=False`` can be passed to
:func:`.create_engine`.

.. versionchanged:: 1.3 Unicode conversion is applied to all string values
   by default under python 2.  The ``coerce_to_unicode`` now defaults to True
   and can be set to False to disable the Unicode coercion of strings that are
   delivered as VARCHAR2/CHAR/CLOB data.


.. _cx_oracle_setinputsizes:

Fine grained control over cx_Oracle data binding performance with setinputsizes
-------------------------------------------------------------------------------

The cx_Oracle DBAPI has a deep and fundamental reliance upon the usage of the
DBAPI ``setinputsizes()`` call.   The purpose of this call is to establish the
datatypes that are bound to a SQL statement for Python values being passed as
parameters.  While virtually no other DBAPI assigns any use to the
``setinputsizes()`` call, the cx_Oracle DBAPI relies upon it heavily in its
interactions with the Oracle client interface, and in some scenarios it is  not
possible for SQLAlchemy to know exactly how data should be bound, as some
settings can cause profoundly different performance characteristics, while
altering the type coercion behavior at the same time.

Users of the cx_Oracle dialect are **strongly encouraged** to read through
cx_Oracle's list of built-in datatype symbols at
http://cx-oracle.readthedocs.io/en/latest/module.html#types.
Note that in some cases, significant performance degradation can occur when
using these types vs. not, in particular when specifying ``cx_Oracle.CLOB``.

On the SQLAlchemy side, the :meth:`.DialectEvents.do_setinputsizes` event can
be used both for runtime visibility (e.g. logging) of the setinputsizes step as
well as to fully control how ``setinputsizes()`` is used on a per-statement
basis.

.. versionadded:: 1.2.9 Added :meth:`.DialectEvents.setinputsizes`


Example 1 - logging all setinputsizes calls
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The following example illustrates how to log the intermediary values from a
SQLAlchemy perspective before they are converted to the raw ``setinputsizes()``
parameter dictionary.  The keys of the dictionary are :class:`.BindParameter`
objects which have a ``.key`` and a ``.type`` attribute::

    from sqlalchemy import create_engine, event

    engine = create_engine("oracle+cx_oracle://scott:tiger@host/xe")

    @event.listens_for(engine, "do_setinputsizes")
    def _log_setinputsizes(inputsizes, cursor, statement, parameters, context):
        for bindparam, dbapitype in inputsizes.items():
                log.info(
                    "Bound parameter name: %s  SQLAlchemy type: %r  "
                    "DBAPI object: %s",
                    bindparam.key, bindparam.type, dbapitype)

Example 2 - remove all bindings to CLOB
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``CLOB`` datatype in cx_Oracle incurs a significant performance overhead,
however is set by default for the ``Text`` type within the SQLAlchemy 1.2
series.   This setting can be modified as follows::

    from sqlalchemy import create_engine, event
    from cx_Oracle import CLOB

    engine = create_engine("oracle+cx_oracle://scott:tiger@host/xe")

    @event.listens_for(engine, "do_setinputsizes")
    def _remove_clob(inputsizes, cursor, statement, parameters, context):
        for bindparam, dbapitype in list(inputsizes.items()):
            if dbapitype is CLOB:
                del inputsizes[bindparam]

.. _cx_oracle_returning:

RETURNING Support
-----------------

The cx_Oracle dialect implements RETURNING using OUT parameters.
The dialect supports RETURNING fully, however cx_Oracle 6 is recommended
for complete support.

.. _cx_oracle_lob:

LOB Objects
-----------

cx_oracle returns oracle LOBs using the cx_oracle.LOB object.  SQLAlchemy
converts these to strings so that the interface of the Binary type is
consistent with that of other backends, which takes place within a cx_Oracle
outputtypehandler.

cx_Oracle prior to version 6 would require that LOB objects be read before
a new batch of rows would be read, as determined by the ``cursor.arraysize``.
As of the 6 series, this limitation has been lifted.  Nevertheless, because
SQLAlchemy pre-reads these LOBs up front, this issue is avoided in any case.

To disable the auto "read()" feature of the dialect, the flag
``auto_convert_lobs=False`` may be passed to :func:`.create_engine`.  Under
the cx_Oracle 5 series, having this flag turned off means there is the chance
of reading from a stale LOB object if not read as it is fetched.   With
cx_Oracle 6, this issue is resolved.

.. versionchanged:: 1.2  the LOB handling system has been greatly simplified
   internally to make use of outputtypehandlers, and no longer makes use
   of alternate "buffered" result set objects.

Two Phase Transactions Not Supported
-------------------------------------

Two phase transactions are **not supported** under cx_Oracle due to poor
driver support.   As of cx_Oracle 6.0b1, the interface for
two phase transactions has been changed to be more of a direct pass-through
to the underlying OCI layer with less automation.  The additional logic
to support this system is not implemented in SQLAlchemy.

.. _cx_oracle_numeric:

Precision Numerics
------------------

SQLAlchemy's numeric types can handle receiving and returning values as Python
``Decimal`` objects or float objects.  When a :class:`.Numeric` object, or a
subclass such as :class:`.Float`, :class:`.oracle.DOUBLE_PRECISION` etc. is in
use, the :paramref:`.Numeric.asdecimal` flag determines if values should be
coerced to ``Decimal`` upon return, or returned as float objects.   To make
matters more complicated under Oracle, Oracle's ``NUMBER`` type can also
represent integer values if the "scale" is zero, so the Oracle-specific
:class:`.oracle.NUMBER` type takes this into account as well.

The cx_Oracle dialect makes extensive use of connection- and cursor-level
"outputtypehandler" callables in order to coerce numeric values as requested.
These callables are specific to the specific flavor of :class:`.Numeric` in
use, as well as if no SQLAlchemy typing objects are present.   There are
observed scenarios where Oracle may sends incomplete or ambiguous information
about the numeric types being returned, such as a query where the numeric types
are buried under multiple levels of subquery.  The type handlers do their best
to make the right decision in all cases, deferring to the underlying cx_Oracle
DBAPI for all those cases where the driver can make the best decision.

When no typing objects are present, as when executing plain SQL strings, a
default "outputtypehandler" is present which will generally return numeric
values which specify precision and scale as Python ``Decimal`` objects.  To
disable this coercion to decimal for performance reasons, pass the flag
``coerce_to_decimal=False`` to :func:`.create_engine`::

    engine = create_engine("oracle+cx_oracle://dsn", coerce_to_decimal=False)

The ``coerce_to_decimal`` flag only impacts the results of plain string
SQL staements that are not otherwise associated with a :class:`.Numeric`
SQLAlchemy type (or a subclass of such).

.. versionchanged:: 1.2  The numeric handling system for cx_Oracle has been
   reworked to take advantage of newer cx_Oracle features as well
   as better integration of outputtypehandlers.

i(tabsolute_importNi(tbase(tOracleCompiler(t
OracleDialect(tOracleExecutionContexti(texc(t
processors(ttypes(tutil(tresult(tcompatt_OracleIntegercB@s#eZd�Zd�Zd�ZRS(cC@stS(N(tint(tselftdbapi((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytget_dbapi_type+scC@s+|j}|j|jdd|jdt�S(Ni�t	arraysizetoutconverter(RtvartSTRINGRR(R
tdialecttcursort	cx_Oracle((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt_cx_oracle_var0s	c@s��fd�}|S(Nc@s�j�|�S(N(R(Rtnametdefault_typetsizet	precisiontscale(RR
(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pythandler7s((R
RR((RR
sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt_cx_oracle_outputtypehandler6s(t__name__t
__module__RRR(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR*s		t_OracleNumericcB@s)eZeZd�Zd�Zd�ZRS(c@sR|jdkrdS|jrGtjtj|j���fd�}|StjSdS(Nic@sIt|ttf�r�|�S|dk	rA|j�rAt|�S|SdS(N(t
isinstanceRtfloattNonetis_infinite(tvalue(t	processor(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytprocessHs


(	RR$t	asdecimalRtto_decimal_processor_factorytdecimaltDecimalt_effective_decimal_return_scaletto_float(R
RR(((R'sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytbind_processor@s	cC@sdS(N(R$(R
Rtcoltype((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytresult_processorTsc@s.�j��j�����fd�}|S(Nc@sd}|r��jr]|�jkr6|}tj}q�rHtj}q�j}�j}q��jrv|dkrvdS�j}ns�jr�|�jkr�|}tj}q��r�tj}q��j}�j}n"�jr�|dkr�dS�j}|j|dd|j	d|�S(Nii�RR(
R$R)tNATIVE_FLOATR+R,Rt_to_decimalt	is_numberRR(RRRRRRRttype_(RRtis_cx_oracle_6R
(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR\s:						(Rt_is_cx_oracle_6(R
RR((RRR6R
sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRWs		2(RR tFalseR4R/R1R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR!=s		t_OracleBinaryFloatcB@seZd�ZRS(cC@s|jS(N(R2(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR9�st_OracleBINARY_FLOATcB@seZRS((RR (((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR:�st_OracleBINARY_DOUBLEcB@seZRS((RR (((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR;�st
_OracleNUMBERcB@seZeZRS((RR tTrueR4(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR<�st_OracleDatecB@seZd�Zd�ZRS(cC@sdS(N(R$(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR/�scC@s
d�}|S(NcS@s|dk	r|j�S|SdS(N(R$tdate(R&((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR(�s
((R
RR0R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR1�s	(RR R/R1(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR>�s	t_OracleCharcB@seZd�ZRS(cC@s|jS(N(t
FIXED_CHAR(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR@�st_OracleUnicodeStringNCHARcB@seZd�ZRS(cC@s|jS(N(tNCHAR(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRB�st_OracleUnicodeStringCHARcB@seZd�ZRS(cC@sdS(N(R$(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRD�st_OracleUnicodeTextNCLOBcB@seZd�ZRS(cC@s|jS(N(tNCLOB(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRE�st_OracleUnicodeTextCLOBcB@seZd�ZRS(cC@s|jS(N(tCLOB(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRG�st_OracleTextcB@seZd�ZRS(cC@s|jS(N(RH(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRI�st_OracleLongcB@seZd�ZRS(cC@s|jS(N(tLONG_STRING(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRJ�st
_OracleStringcB@seZRS((RR (((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRL�st_OracleEnumcB@seZd�ZRS(c@s(tjj||���fd�}|S(Nc@s�|�}|S(N((R&traw_str(t	enum_proc(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR(�s(tsqltypestEnumR/(R
RR(((ROsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR/�s(RR R/(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRM�st
_OracleBinarycB@s#eZd�Zd�Zd�ZRS(cC@s|jS(N(tBLOB(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�scC@sdS(N(R$(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR/�scC@s*|js
dStt|�j||�SdS(N(tauto_convert_lobsR$tsuperRRR1(R
RR0((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR1�s	(RR RR/R1(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRR�s		t_OracleIntervalcB@seZd�ZRS(cC@s|jS(N(tINTERVAL(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRV�st
_OracleRawcB@seZRS((RR (((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRX�st_OracleRowidcB@seZd�ZRS(cC@s|jS(N(tROWID(R
R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�s(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRY�stOracleCompiler_cx_oraclecB@seZeZd�ZRS(cK@s�t|dd�}|tks<|tk	r�|jj|�r�|jdt�rdtjd|��nd|}||j	|<t
j|||�St
j|||�SdS(Ntquotet	expandingsyCan't use expanding feature with parameter name %r on Oracle; it requires quoting which is not supported in this context.s"%s"(tgetattrR$R=R8tpreparert_bindparam_requires_quotestgetRtCompileErrort_quoted_bind_namesRtbindparam_string(R
RtkwR\tquoted_name((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRds


(RR R=t_oracle_cx_sql_compilerRd(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR[st OracleExecutionContext_cx_oraclecB@sMeZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(cC@s_|jj}|r[xF|jD]8}x/|j�D]!\}}||||<||=q/WqWndS(N(tcompiledRct
parameterstitems(R
tquoted_bind_namestparamtfromnamettoname((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt_setup_quoted_bind_namesscC@s't|j�dkr#|jj}x�|jjj�D]�}|jr4|jj|}|jj	|j
�}t|d�r�|j|j
|j
�|j|<n\|j|j
j�}|dkr�tjd|j|jf��n|j
j|�|j|<|j||jd|j||�<q4q4WndS(NiRsXCannot create out parameter for parameter %r - its type %r is not supported by cx_oraclei(tlentcompiled_parametersRiRctbindstvaluest
isoutparamt
bind_namesttypetdialect_implRthasattrRRtout_parametersRRR$RtInvalidRequestErrortkeyRRjRa(R
Rlt	bindparamRt	type_impltdbtype((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt_handle_out_parameters"s 	c@s�i�x`|jjD]R\}}}}|j|jd|j�}|r|jj|�}|�|<qqW�r�|jj���fd�}||j_ndS(Ntcx_oracle_outputtypehandlerc@sF|�kr)�|||||||�S�||||||�SdS(N((RRRRRR(tdefault_handlertoutput_handlers(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytoutput_type_handlerLs
(	Rit_result_columnst_cached_custom_processorRt_get_cx_oracle_type_handlertdenormalize_namet_dbapi_connectiontoutputtypehandlerR(R
tkeynameRtobjectsR5Rtdenormalized_nameR�((R�R�sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt#_generate_cursor_outputtype_handler;scC@s't|d�r|j|j�SdSdS(NR(RyRRR$(R
timpl((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�ZscC@srt|jdt�sdSi|_|jjr;|j�n|j|jjd|jj�|j	�|j
�dS(NRgt
include_types(R^RiR8RzRcRptset_input_sizesRt_include_setinputsizesR�R�(R
((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytpre_exec`s	


cC@s1|jj�}|jjr-|jj|_n|S(N(R�RRR(R
tc((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt
create_cursorrsc@s��jra�jjragtt�j��D]#}�jj�jd|�^q+}t�|�Stj	��}�jr��j
dk	rvt�j
�dkrvi|_}x��jjj
�D]�\}}|�jkr�|j}|j�j�}|j�jj�}	|j�j|	�}
|
dk	rO|
�jj�j|��||<qo�jj�j|�||<q�q�Wq�t�fd��jj
�D��|_n|S(Nsret_%dic3@s-|]#\}}|�jj|�fVqdS(N(t_dialectt	_paramval(t.0tktv(R
(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pys	<genexpr>�s(RzRit	returningtrangeRqRt
_returningvaltReturningResultProxyt_resulttResultProxyRrR$RvRkRwRxRRR1R�tdict(R
titreturning_paramsR	RztbindRR5t	impl_typet
dbapi_typeR1((R
sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytget_result_proxyys6<
	
			N(RR R$RzRpR�R�R�R�R�R�(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRhs						R�cB@s)eZdZd�Zd�Zd�ZRS(sOResult proxy which stuffs the _returning clause + outparams
    into the fetch.cC@s#||_tt|�j|�dS(N(t_returning_paramsRUR�t__init__(R
tcontextR�((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR��s	cC@s;|jjj}g|D]!}t|d|j�df^qS(NR(R�RiR�R^t
anon_labelR$(R
R�tcol((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt_cursor_description�scC@stjt|j�g�S(N(tcollectionstdequettupleR�(R
((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt_buffer_rows�s(RR t__doc__R�R�R�(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR��s		tOracleDialect_cx_oraclecB@s eZeZeZeZeZeZ	eZ
dZiee
j6ee
j6eej6eej6ee
j6eej6ee
j6ee
j6eje
j6ee
j 6eej!6e"e
j#6e$e
j%6e&e
j'6e(e
j)6e*e
j+6e,ej-6e.ej/6e0e
j16e2e
j36e2e
j46e5ej66e7ej86Z9e:Z;dZ=e>j?dd�eeeddd��Z@d�ZAeBd��ZCd�ZDd	�ZEd
�ZFeGjHZId�ZJd�ZKd
�ZLd�ZMd�ZNe>jOdd�d��ZPdd�ZQd�ZRd�ZSeeTd�ZUeeTd�ZVd�ZWRS(t	cx_oracletthreadeds1.3s5The 'threaded' parameter to the cx_oracle dialect is deprecated as a dialect-level argument, and will be removed in a future release.  As of version 1.3, it defaults to False rather than True.  The 'threaded' option can be passed to cx_Oracle directly in the URL query string passed to :func:`.create_engine`.i2c	K@s�tj||�||_|dk	r1||_n||_||_||_|jr�|j	j
�|_	t|j	tj
<t|j	tj<n|j}|dkr�i|_d	|_n�|j|j�|_|jd
kr�|jdkr�tjd��n|j|j|j|j|j|j|j|jtt t!h|_d�|_"|jdk|_#|j#r�t$|j%_&d�}||_'n|j"|_'|jd
k|_(dS(Niiis-cx_Oracle version 5.2 and above are supportedcS@s
|j�S(N(tgetvalue(R&((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt<lambda>tiicS@s,y|jddSWntk
r'dSXdS(Ni(Rtt
IndexErrorR$(R&((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�&s
(iii(ii(iii(ii(i()RR�RR$t_cx_oracle_threadedRTtcoerce_to_unicodetcoerce_to_decimalt_use_nchar_for_unicodetcolspecstcopyRBRPtUnicodeREtUnicodeTextRR�t
cx_oracle_vert_parse_cx_oracle_vertversionRR{RFRHtLOBRCtFIXED_NCHARRSRAt	TIMESTAMPRR:R;R�t_values_are_listsR=t
__future__tdml_ret_array_valR�R7(	R
RTR�R�RR�tkwargsRR�((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR��sL									cC@sCtjd|�}|r;td�|jddd�D��SdSdS(Ns(\d+)\.(\d+)(?:\.(\d+))?cs@s'|]}|dk	rt|�VqdS(N(R$R(R�tx((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pys	<genexpr>5siiii(iii(tretmatchR�tgroup(R
R�tm((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�2s#cC@sddl}|S(Ni(R(tclsR((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR9scC@s<tt|�j|�|jr+t|_n|j|�dS(N(RUR�t
initializet_is_oracle_8R8tsupports_unicode_bindst_detect_decimal_char(R
t
connection((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�?s	c@sh|jd�d�_�jdkrd�j��j���fd��_��fd��_ndS(NsSselect value from nls_session_parameters where parameter = 'NLS_NUMERIC_CHARACTERS'it.c@s�|j�jd��S(NR�(treplacet
_decimal_char(R&(t_detect_decimalR
(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�Usc@s�|j�jd��S(NR�(R�R�(R&(R3R
(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�Xs(tscalarR�R�R3(R
R�((R�R3R
sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�Fs
		cC@s'd|kr|j|�St|�SdS(NR�(R3R(R
R&((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�\s
c@s[|��j�tdt�j���tdt�j�������fd�}|S(s^establish the default outputtypehandler established at the
        connection level.

        R)c@s�|�jkr��jsdS|dkrY|d	krY|j�jdd�jd|j�S|r�|dkr��||||||�S�||||||�Sn:�jr|�j�jfkrt	j
r�tj�j
d��|j�j||jd��S|jtj||j�Sn��jr�|�j�jfkr�t	j
r~tj�j
d��|j|||jd�fd��S|j|||jdd��Sn:�jr�|�jfkr�|j|||jdd��SdS(
Nii����i�RRc@s�|j��S(N(tread(R&(R(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR��R�cS@s
|j�S(N(R�(R&((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR��R�cS@s
|j�S(N(R�(R&((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR��R�(ii����(tNUMBERR�R$RRR�RR�RAR
tpy2kRtto_unicode_processor_factorytencodingRt	text_typeRTRHRFRS(RRRRRR(RRt
float_handlertnumber_handler(RsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR�tsb		
					
	(RR<R=RR8(R
R�((RRR�R�sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt'_generate_connection_outputtype_handlerds					Jc@s|j���fd�}|S(Nc@s
�|_dS(N(R�(tconn(R�(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt
on_connect�s(R�(R
R�((R�sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR��sc
@s	t|j�}xZdD]R}||krtjd|�tj||t�t�||j|��qqW|j}|jdd�}|s�|r|j
}|r�t|�}nd}|r�|r�tj
d��n|r�i|d6}n|ri|d6}n�jj|j||�}n	|j}|dk	rA||d<n|jdk	r`|j|d	<n|jdk	r|j|d
<n�jdk	r�|jd�j�n�fd�}	tj|d
|	�tj|dt�tj|dt�tj|d|	�g|fS(Ntuse_ansiRTsfcx_oracle dialect option %r should only be passed to create_engine directly, not within the URL stringtservice_namei�sI"service_name" option shouldn't be used with a "database" part of the urltsidtdsntpasswordtuserR�c@s^t|tj�rVyt|�}Wn*tk
rN|j�}t�j|�SX|Sn|SdS(N(R"Rtstring_typesRt
ValueErrortupperR^R(R&tint_val(R
(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytconvert_cx_oracle_constant�s
tmodeteventstpurity(R�RT(R�tqueryRtwarn_deprecatedtcoerce_kw_typetbooltsetattrtpoptdatabaseR$tportRRR{RtmakedsnthostR�tusernameR�t
setdefault(
R
turltoptstoptR�R�R�tmakedsn_kwargsR�R�((R
sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytcreate_connect_args�sL
 			
cC@s#td�|jjjd�D��S(Ncs@s|]}t|�VqdS(N(R(R�R�((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pys	<genexpr>
sR�(R�R�R�tsplit(R
R�((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt_get_server_version_infoscC@sg|j\}t||jj|jjf�rCdt|�krCtSt|d�r_|jd	kSt	SdS(
Ns
not connectedtcodeii*i)i?i	i\	(ii*i)i?i	i\	(
targsR"RtInterfaceErrort
DatabaseErrortstrR=RyRR8(R
teR�Rterror((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt
is_disconnects
s1.2sThe create_xid() method of the cx_Oracle dialect is deprecated and will be removed in a future release.  Two-phase transaction support is no longer functional in SQLAlchemy's cx_Oracle dialect as of cx_Oracle 6.0b1, which no longer supports the API that SQLAlchemy relied upon.cC@s'tjdd�}dd|ddfS(s�create a two-phase transaction ID.

        this id will be passed to do_begin_twophase(), do_rollback_twophase(),
        do_commit_twophase().  its format is unspecified.

        iii�i4s%032xi	l	(trandomtrandint(R
tid_((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt
create_xid"scC@s2t|t�rt|�}n|j||�dS(N(R"R�tlisttexecutemany(R
Rt	statementRjR�((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytdo_executemany5scC@s|jj|�dS(N(R�tbegin(R
R�txid((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytdo_begin_twophase:scC@s |jj�}||jd<dS(Ntcx_oracle_prepared(R�tpreparetinfo(R
R�RR	((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytdo_prepare_twophase=scC@s|j|j�dS(N(tdo_rollbackR�(R
R�Rtis_preparedtrecover((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytdo_rollback_twophaseAscC@sC|s|j|j�n&|jd}|r?|j|j�ndS(NR(t	do_commitR�R(R
R�RR R!toci_prepared((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytdo_commit_twophaseFs

cC@s|jjdd�dS(NR(RR�R$(R
R�((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytdo_recover_twophasePsN(s1.3s5The 'threaded' parameter to the cx_oracle dialect is deprecated as a dialect-level argument, and will be removed in a future release.  As of version 1.3, it defaults to False rather than True.  The 'threaded' option can be passed to cx_Oracle directly in the URL query string passed to :func:`.create_engine`.(XRR Rhtexecution_ctx_clsR[tstatement_compilerR=tsupports_sane_rowcounttsupports_sane_multi_rowcounttsupports_unicode_statementsR�tdriverR!RPtNumerictFloatR:toracletBINARY_FLOATR;t
BINARY_DOUBLERtIntegerR<R�R>tDateRRtLargeBinaryt_OracleBooleantBooleanRVtIntervalRWRItTextRLtStringRGR�R@tCHARRMRQRJtLONGRXtRAWRDR�RBtNVARCHARRCRERFRYRZR�Rtexecute_sequence_formatR$R�Rtdeprecated_paramsR�R�tclassmethodRR�R�R�R+R,R3R�R�RRRt
deprecatedRRRRR8R"R%R&(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR��sz






















	
>						\			C					(BR�R�RR�R+RR�R�RR/RRRRRRRPRtengineR	R�R
R2RR-R!R9R0R:R1R;R<R3R>R:R@t	NVARCHAR2RBR�RDRFRER�RGR8RIR;RJR9RLRQRMR4RRRWRVR<RXRZRYR[RhtFullyBufferedResultProxyR�R�R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt<module>sRT���

Zerion Mini Shell 1.0