ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 4]c@@s?dZddlmZddlZddlZddlZddlZddlmZ ddlm Z ddlm Z ddlm Z d d lm Z d d lmZd d lmZd d lmZd dlmZd dlmZdejfdYZdejfdYZdefdYZdee jfdYZdee jfdYZdefdYZdej fdYZ!dej"fdYZ#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/YZ3d0ej4fd1YZ5d2e j6fd3YZ7d4e j8fd5YZ9d6e j:fd7YZ;d8e fd9YZ<d:e fd;YZ=d<ej>fd=YZ?d>e fd?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#eZdZdZdZRS(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|jdtS(Nit 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@sfd}|S(Nc@sj|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)eZeZdZdZdZRS(c@sR|jdkrdS|jrGtjtj|jfd}|StjSdS(Nic@sIt|ttfr|S|dk rA|jrAt|S|SdS(N(t isinstanceR tfloattNonet is_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.jjfd}|S(Nc@sd}|rjr]|jkr6|}tj}qrHtj}qj}j}qjrv|dkrvdSj}nsjr|jkr|}tj}qrtj}qj}j}n"jr|dkrdSj}|j|dd|j d|S(NiiRR( 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@seZdZRS(cC@s|jS(N(R2(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR9st_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@seZdZdZRS(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|jS|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.pyR1s (RR R/R1(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR>s t _OracleCharcB@seZdZRS(cC@s|jS(N(t FIXED_CHAR(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR@st_OracleUnicodeStringNCHARcB@seZdZRS(cC@s|jS(N(tNCHAR(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRBst_OracleUnicodeStringCHARcB@seZdZRS(cC@sdS(N(R$(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRDst_OracleUnicodeTextNCLOBcB@seZdZRS(cC@s|jS(N(tNCLOB(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyREst_OracleUnicodeTextCLOBcB@seZdZRS(cC@s|jS(N(tCLOB(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRGst _OracleTextcB@seZdZRS(cC@s|jS(N(RH(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRIst _OracleLongcB@seZdZRS(cC@s|jS(N(t LONG_STRING(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRJst _OracleStringcB@seZRS((RR (((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRLst _OracleEnumcB@seZdZRS(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.pyRMst _OracleBinarycB@s#eZdZdZdZRS(cC@s|jS(N(tBLOB(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRscC@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.pyR1s (RR RR/R1(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRRs  t_OracleIntervalcB@seZdZRS(cC@s|jS(N(tINTERVAL(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRVst _OracleRawcB@seZRS((RR (((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRXst _OracleRowidcB@seZdZRS(cC@s|jS(N(tROWID(R R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs(RR R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRYstOracleCompiler_cx_oraclecB@seZeZdZRS(cK@st|dd}|tks<|tk r|jj|r|jdtrdtjd|nd|}||j |s(RzRit returningtrangeRqRt _returningvaltReturningResultProxyt_resultt ResultProxyRrR$RvRkRwRxRRR1Rtdict( 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$RzRpRRRRRR(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRhs      RcB@s)eZdZdZdZdZRS(sOResult proxy which stuffs the _returning clause + outparams into the fetch.cC@s#||_tt|j|dS(N(t_returning_paramsRURt__init__(R tcontextR((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs cC@s;|jjj}g|D]!}t|d|jdf^qS(NR(RRiRR^t anon_labelR$(R Rtcol((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt_cursor_descriptionscC@stjt|jgS(N(t collectionstdequettupleR(R ((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt _buffer_rowss(RR t__doc__RRR(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs  tOracleDialect_cx_oraclecB@s eZeZeZeZeZeZ eZ dZ ie 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?ddeeedddZ@dZAeBdZCdZDd ZEd ZFeGjHZId ZJd ZKd ZLdZMdZNe>jOdddZPddZQdZRdZSeeTdZUeeTdZVdZWRS(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@stj||||_|dk r1||_n||_||_||_|jr|j j |_ t |j t j 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()RRRR$t_cx_oracle_threadedRTtcoerce_to_unicodetcoerce_to_decimalt_use_nchar_for_unicodetcolspecstcopyRBRPtUnicodeREt UnicodeTextRRt cx_oracle_vert_parse_cx_oracle_vertversionRR{RFRHtLOBRCt FIXED_NCHARRSRAt TIMESTAMPR R:R;Rt_values_are_listsR=t __future__tdml_ret_array_valRR7( R RTRRRRtkwargsRR((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRsL                   cC@sCtjd|}|r;td|jdddDSdSdS(Ns(\d+)\.(\d+)(?:\.(\d+))?cs@s'|]}|dk rt|VqdS(N(R$R (Rtx((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pys 5siiii(iii(tretmatchRtgroup(R Rtm((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyR2s#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(RURt 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|jdd_jdkrdjjfd_fd_ndS(NsSselect value from nls_session_parameters where parameter = 'NLS_NUMERIC_CHARACTERS'it.c@s|jjdS(NR(treplacet _decimal_char(R&(t_detect_decimalR (sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRUsc@s|jjdS(NR(RR(R&(R3R (sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRXs(tscalarRRR3(R R((RR3R sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRFs   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[|jtdtjtdtjfd}|S(s^establish the default outputtypehandler established at the connection level. R)c@s|jkrjsdS|dkrY|d krY|jjddjd|jS|r|dkr||||||S||||||Sn:jr|jjfkrt j rt j j d|jj||jdS|jtj||jSnjr|jjfkrt j r~t j j d|j|||jdfdS|j|||jddSn:jr|jfkr|j|||jddSdS( NiiiRRc@s|jS(N(tread(R&(R(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRRcS@s |jS(N(R(R&((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRRcS@s |jS(N(R(R&((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRR(ii(tNUMBERRR$RRRRRRAR 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.pyRtsb             (RR<R=RR8(R R((RRRRsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt'_generate_connection_outputtype_handlerds     Jc@s|jfd}|S(Nc@s |_dS(N(R(tconn(R(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt on_connects(R(R R((RsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRs c @s t|j}xZdD]R}||krtjd|tj||tt||j|qqW|j}|jdd}|s|r|j }|rt |}nd}|r|rt j dn|ri|d6}n|ri|d6}njj|j||}n |j}|dk rA||d sR(RRRtsplit(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|jjfrCdt|krCtSt|dr_|jd kSt SdS( Ns not connectedtcodeii* i) i? i i\ (ii* i) i? i i\ ( targsR"RtInterfaceErrort DatabaseErrortstrR=RyRR8(R teRRterror((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(screate a two-phase transaction ID. this id will be passed to do_begin_twophase(), do_rollback_twophase(), do_commit_twophase(). its format is unspecified. iiii4s%032xi l (trandomtrandint(R tid_((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyt create_xid"scC@s2t|trt|}n|j||dS(N(R"Rtlistt executemany(R Rt statementRjR((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytdo_executemany5scC@s|jj|dS(N(Rtbegin(R Rtxid((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytdo_begin_twophase:scC@s |jj}||jdtDateRRt LargeBinaryt_OracleBooleantBooleanRVtIntervalRWRItTextRLtStringRGRR@tCHARRMRQRJtLONGRXtRAWRDRRBtNVARCHARRCRERFRYRZRRtexecute_sequence_formatR$RRtdeprecated_paramsRRt classmethodRRRRR+R,R3RRRRRt deprecatedRRRRR8R"R%R&(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pyRsz                         >      \ C      (BRRRRR+RRRRR/RRRRRRRPRtengineR RR R2R R-R!R9R0R:R1R;R<R3R>R:R@t NVARCHAR2RBRRDRFRERRGR8RIR;RJR9RLRQRMR4RRRWRVR<RXRZRYR[RhtFullyBufferedResultProxyRRR(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.pytsR    T