Skip to content

Commit 16568e1

Browse files
authored
Revert "Improve example docs around SQLExecuteQueryOperator in Postgres/Oracle/Presto/Vertica/ODBC (apache#46352)" (apache#46368)
This reverts commit 454afb5.
1 parent c60e139 commit 16568e1

File tree

17 files changed

+68
-685
lines changed

17 files changed

+68
-685
lines changed

providers/odbc/docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
:caption: Guides
3636

3737
Connection types <connections/odbc>
38-
Operators <operators>
3938

4039
.. toctree::
4140
:hidden:

providers/odbc/docs/operators.rst

Lines changed: 0 additions & 95 deletions
This file was deleted.

providers/odbc/tests/system/odbc/example_odbc.py

Lines changed: 0 additions & 96 deletions
This file was deleted.

providers/oracle/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
:caption: Guides
3636

3737
Connection types <connections/oracle>
38-
Operators <operators>
38+
Operators <operators/index>
3939

4040
.. toctree::
4141
:hidden:

providers/oracle/docs/operators.rst

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
.. Licensed to the Apache Software Foundation (ASF) under one
2+
or more contributor license agreements. See the NOTICE file
3+
distributed with this work for additional information
4+
regarding copyright ownership. The ASF licenses this file
5+
to you under the Apache License, Version 2.0 (the
6+
"License"); you may not use this file except in compliance
7+
with the License. You may obtain a copy of the License at
8+
9+
.. http://www.apache.org/licenses/LICENSE-2.0
10+
11+
.. Unless required by applicable law or agreed to in writing,
12+
software distributed under the License is distributed on an
13+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
KIND, either express or implied. See the License for the
15+
specific language governing permissions and limitations
16+
under the License.
17+
18+
19+
.. _howto/operators:oracle:
20+
21+
Oracle Operators
22+
================
23+
The Oracle connection type provides connection to a Oracle database.
24+
25+
Execute a Stored Procedure in an Oracle database
26+
------------------------------------------------
27+
28+
To execute a Stored Procedure in an Oracle database, use the
29+
:class:`~airflow.providers.oracle.operators.oracle.OracleStoredProcedureOperator`.
30+
31+
Assume a stored procedure exists in the database that looks like this:
32+
33+
.. code-block:: sql
34+
35+
CREATE OR REPLACE PROCEDURE
36+
TEST_PROCEDURE (val_in IN INT, val_out OUT INT) AS
37+
BEGIN
38+
val_out := val_in * 2;
39+
END;
40+
/
41+
42+
This stored procedure accepts a single integer argument, val_in, and outputs
43+
a single integer argument, val_out. This can be represented with the following
44+
call using :class:`~airflow.providers.oracle.operators.oracle.OracleStoredProcedureOperator`
45+
with parameters passed positionally as a list:
46+
47+
.. exampleinclude:: /../../providers/oracle/src/airflow/providers/oracle/example_dags/example_oracle.py
48+
:language: python
49+
:start-after: [START howto_oracle_stored_procedure_operator_with_list_inout]
50+
:end-before: [END howto_oracle_stored_procedure_operator_with_list_inout]
51+
52+
53+
Alternatively, parameters can be passed as keyword arguments using a dictionary
54+
as well.
55+
56+
.. exampleinclude:: /../../providers/oracle/src/airflow/providers/oracle/example_dags/example_oracle.py
57+
:language: python
58+
:start-after: [START howto_oracle_stored_procedure_operator_with_dict_inout]
59+
:end-before: [END howto_oracle_stored_procedure_operator_with_dict_inout]
60+
61+
Both input and output will be passed to xcom provided that xcom push is requested.
62+
63+
More on stored procedure execution can be found in `oracledb documentation
64+
<https://python-oracledb.readthedocs.io/en/latest/user_guide/plsql_execution.html#pl-sql-stored-procedures>`_.

providers/oracle/tests/system/oracle/__init__.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)