Documentation updates.
This commit is contained in:
parent
5def438665
commit
5052665dd5
|
@ -90,11 +90,12 @@ Connection Methods
|
||||||
|
|
||||||
Commits any pending transactions to the database.
|
Commits any pending transactions to the database.
|
||||||
|
|
||||||
.. method:: Connection.createlob(lobType)
|
.. method:: Connection.createlob(lob_type)
|
||||||
|
|
||||||
Creates and returns a new temporary :ref:`LOB object <lobobj>` of the
|
Creates and returns a new temporary :ref:`LOB object <lobobj>` of the
|
||||||
specified type. The ``lobType`` parameter should be one of
|
specified type. The ``lob_type`` parameter should be one of
|
||||||
:data:`oracledb.CLOB`, :data:`oracledb.BLOB` or :data:`oracledb.NCLOB`.
|
:data:`oracledb.DB_TYPE_CLOB`, :data:`oracledb.DB_TYPE_BLOB`, or
|
||||||
|
:data:`oracledb.DB_TYPE_NCLOB`.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
@ -540,8 +541,8 @@ Connection Attributes
|
||||||
.. attribute:: Connection.action
|
.. attribute:: Connection.action
|
||||||
|
|
||||||
This write-only attribute sets the action column in the v$session table. It
|
This write-only attribute sets the action column in the v$session table. It
|
||||||
is a string attribute and cannot be set to None -- use the empty string
|
is a string attribute but the value None is accepted and treated as an
|
||||||
instead.
|
empty string.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
@ -917,6 +918,6 @@ Connection Attributes
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
If you connect to Oracle Database 18 or higher with client libraries
|
If you connect to Oracle Database 18 or higher using Oracle Client
|
||||||
12.2 or lower that you will only receive the base version (such as
|
libraries 12.2 or lower you will only receive the base version (such as
|
||||||
18.0.0.0.0) instead of the full version (18.3.0.0.0).
|
18.0.0.0.0) instead of the full version (such as 18.3.0.0.0).
|
||||||
|
|
|
@ -8,6 +8,16 @@ The following tables contain all of the deprecations in the python-oracledb API,
|
||||||
when they were first deprecated and a comment on what should be used instead,
|
when they were first deprecated and a comment on what should be used instead,
|
||||||
if applicable. The most recent deprecations are listed first.
|
if applicable. The most recent deprecations are listed first.
|
||||||
|
|
||||||
|
.. list-table-with-summary:: Desupported in python-oracledb 2.0
|
||||||
|
:header-rows: 1
|
||||||
|
:class: wy-table-responsive
|
||||||
|
:summary: The first column, Name, displays the deprecated or desupported API name. The second column, Comments, includes information about when the API was deprecated or desupported and what API to use, if applicable.
|
||||||
|
:name: _deprecations_2_0
|
||||||
|
|
||||||
|
* - Name
|
||||||
|
- Comments
|
||||||
|
* - ``oracledb.__future__.old_json_col_as_obj``
|
||||||
|
- This attribute is desupported and does not need to be set to fetch VARCHAR2 and LOB columns that contain JSON data.
|
||||||
|
|
||||||
.. list-table-with-summary:: Deprecated in python-oracledb 1.4
|
.. list-table-with-summary:: Deprecated in python-oracledb 1.4
|
||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
|
|
|
@ -1518,8 +1518,9 @@ Advanced Queuing: Message States
|
||||||
These constants are extensions to the DB API definition. They are possible
|
These constants are extensions to the DB API definition. They are possible
|
||||||
values for the :attr:`~MessageProperties.state` attribute of the
|
values for the :attr:`~MessageProperties.state` attribute of the
|
||||||
:ref:`message properties object <msgproperties>`. This object is the
|
:ref:`message properties object <msgproperties>`. This object is the
|
||||||
``msgproperties`` parameter for the :meth:`Connection.deq()` and
|
``msgproperties`` parameter for the :meth:`Queue.deqone()` or
|
||||||
:meth:`Queue.enqone()` or :meth:`Queue.enqmany()` methods.
|
:meth:`Queue.deqmany()`, and :meth:`Queue.enqone()` or :meth:`Queue.enqmany()`
|
||||||
|
methods.
|
||||||
|
|
||||||
|
|
||||||
.. data:: MSG_EXPIRED
|
.. data:: MSG_EXPIRED
|
||||||
|
|
|
@ -104,32 +104,27 @@ insert JSON strings like:
|
||||||
|
|
||||||
cursor.execute(inssql, [1, json.dumps(data)])
|
cursor.execute(inssql, [1, json.dumps(data)])
|
||||||
|
|
||||||
You can fetch VARCHAR2 and LOB columns that contain JSON data without needing
|
You can fetch VARCHAR2 and LOB columns that contain JSON data in the same way
|
||||||
to call ``json.loads()`` on the value (similar to
|
that :ref:`JSON type columns <json21fetch>` are fetched when using Oracle
|
||||||
:ref:`fetching JSON type columns <json21fetch>` when using Oracle Database
|
Database 21c or later. If you are using python-oracledb Thick mode, you must
|
||||||
21c). This can be done by setting the attribute
|
use Oracle Client 19c (or later). For example:
|
||||||
:attr:`oracledb.__future__.old_json_col_as_obj` to the value *True* as shown
|
|
||||||
below. If you are using python-oracledb Thick mode, you must also use Oracle
|
|
||||||
Client 19c (or later).
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
oracledb.__future__.old_json_col_as_obj = True
|
|
||||||
|
|
||||||
for row in cursor.execute("select * from CustomersAsBlob"):
|
for row in cursor.execute("select * from CustomersAsBlob"):
|
||||||
print(row)
|
print(row)
|
||||||
|
|
||||||
To fetch JSON without setting the attribute
|
.. versionchanged:: 2.0
|
||||||
``oracledb.__future__.old_json_col_as_obj``, you can use ``json.loads()`` on
|
|
||||||
the returned data. For example, to fetch JSON which uses BLOB storage:
|
|
||||||
|
|
||||||
.. code-block:: python
|
Previously, the ``oracledb.__future__.old_json_col_as_obj`` attribute
|
||||||
|
needed to be set to *True* to fetch VARCHAR2 and LOB columns that
|
||||||
import json
|
contained JSON data. Also, you could fetch JSON data without setting this
|
||||||
|
attribute with a call to ``json.loads()`` on the returned data. With this
|
||||||
sql = "SELECT c.json_data FROM CustomersAsBlob c"
|
change, the ``oracledb.__future__.old_json_col_as_obj`` attribute is
|
||||||
for j, in cursor.execute(sql):
|
desupported. VARCHAR2 and LOB columns containing JSON data can now be
|
||||||
print(json.loads(j.read()))
|
fetched directly without setting the
|
||||||
|
``oracledb.__future__.old_json_col_as_obj`` attribute or without needing
|
||||||
|
to call ``json.loads()`` on the value.
|
||||||
|
|
||||||
See `json_blob.py
|
See `json_blob.py
|
||||||
<https://github.com/oracle/python-oracledb/tree/main/samples/json_blob.py>`__
|
<https://github.com/oracle/python-oracledb/tree/main/samples/json_blob.py>`__
|
||||||
|
|
|
@ -334,7 +334,7 @@ Encryption (NNE) enabled. NNE is only supported in python-oracledb Thick mode.
|
||||||
|
|
||||||
SELECT network_service_banner FROM v$session_connect_info;
|
SELECT network_service_banner FROM v$session_connect_info;
|
||||||
|
|
||||||
If NNE is enabled, then this query prints an output that includes the
|
If NNE is enabled, then this query prints output that includes the
|
||||||
available encryption service, the crypto-checksumming service, and the
|
available encryption service, the crypto-checksumming service, and the
|
||||||
algorithms in use, such as::
|
algorithms in use, such as::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue