Skip to content

Commit 8507c8c

Browse files
authored
DOCSP-45372 Adds convert oracle packages page (#186)
* DOCSP-45372 Adds convert oracle packages page * Updates for accuracy * Adds packages to included file * Adds packages to include bullet * Revise connection step to better reflect UX * Responds to feedback * Adds SME provided code examples
1 parent 1e83e75 commit 8507c8c

File tree

9 files changed

+1325
-10
lines changed

9 files changed

+1325
-10
lines changed

source/code-generation/query-converter.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ your SQL code.
2323
Enable Query Converter </code-generation/query-converter/enable-query-converter>
2424
Convert Queries </code-generation/query-converter/convert-queries>
2525
Convert Stored Procedures </code-generation/query-converter/convert-stored-procedures>
26+
Convert Oracle Packages </code-generation/query-converter/convert-oracle-packages>
2627
Convert Triggers </code-generation/query-converter/convert-triggers>
2728
Convert Views </code-generation/query-converter/convert-views>
2829
Bulk Conversion </code-generation/query-converter/bulk-conversion>
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
.. _rm-convert-oracle-packages:
2+
3+
=======================
4+
Convert Oracle Packages
5+
=======================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
You can import and convert your Oracle Packages to MongoDB code
14+
with the query converter. The query converter considers the mapping
15+
rules and schema transformations defined in your project when
16+
converting your SQL code.
17+
18+
About this Task
19+
---------------
20+
21+
.. include:: /includes/fact-query-converter-generic.rst
22+
23+
- .. include:: /includes/fact-view-query-conversion-history.rst
24+
25+
Before you Begin
26+
----------------
27+
28+
- MongoDB does not have an official synonym object type for Oracle
29+
packages. Instead, MongoDB supports custom JavaScript and
30+
driver code that hosts the database logic. When migrating your
31+
application to MongoDB, you must choose the programming language and
32+
hosting option that best serves your application needs. You can host
33+
your converted Oracle package code in your application or with
34+
:ref:`<atlas-functions>`.
35+
36+
- .. include:: /includes/fact-query-converter-disclaimer.rst
37+
38+
Steps
39+
-----
40+
41+
.. procedure::
42+
:style: normal
43+
44+
.. step:: Navigate to the query converter pane
45+
46+
From the :guilabel:`Code Generation` tab, click the :guilabel:`Query Converter` pane.
47+
48+
.. step:: Open the query converter view
49+
50+
- Click the :guilabel:`+ Add` button on the left-hand pane.
51+
52+
- Click :guilabel:`Import From Database`.
53+
54+
.. step:: Connect to your relational database
55+
56+
If you are not already connected to your source database, specify the
57+
connection details to your source database and click :guilabel:`Connect`.
58+
59+
For more information on database connections in Relational
60+
Migrator, see :ref:`rm-database-connections`.
61+
62+
.. step:: Select Oracle packages
63+
64+
a. On the :guilabel:`Import from database` modal, click
65+
the :icon-fa5:`chevron-right` icon next to :guilabel:`Database`.
66+
67+
#. Click the :icon-fa5:`chevron-right` icon next to your schema.
68+
69+
#. Click the :icon-fa5:`chevron-right` icon next to
70+
:guilabel:`Packages`.
71+
72+
.. tip::
73+
74+
To toggle Oracle packages for conversion, click
75+
the :icon-fa5:`check-square` icon next to the
76+
package's name.
77+
78+
#. Click :guilabel:`Save`.
79+
80+
The code for each package in your database
81+
schema is imported into your project and is visible in the
82+
:guilabel:`Query Converter` pane under
83+
:guilabel:`Packages`.
84+
85+
.. step:: Convert and test code
86+
87+
a. Click a packages's name from the left-hand pane under
88+
:guilabel:`Packages`.
89+
90+
The code displays in the
91+
:guilabel:`Imported Package` pane.
92+
93+
#. Select a :guilabel:`Target Language` from the drop-down.
94+
95+
Query converter supports Oracle package conversions to
96+
Javascript, C#, and Java.
97+
98+
.. include:: /includes/fact-domain-object
99+
100+
#. Click the :guilabel:`Convert` button. Wait for the query
101+
converter to convert your code.
102+
103+
The converted MongoDB code displays
104+
on the :guilabel:`Converted MongoDB Query` pane.
105+
106+
.. include:: /includes/fact-query-converter-failure-errors.rst
107+
108+
#. Click the :icon-fa5:`copy` icon on the
109+
:guilabel:`Converted MongoDB Query` pane to copy the MongoDB
110+
code to your clipboard.
111+
112+
#. Test and validate the generated MongoDB code.
113+
114+
.. tip::
115+
116+
.. include:: /includes/fact-query-converter-filter.rst
117+
118+
Examples
119+
--------
120+
121+
The query converter can convert your packages to Javascript, C#, or
122+
Java code. The example below shows conversions to each language.
123+
124+
.. tabs::
125+
126+
.. tab:: Oracle Package
127+
:tabid: oracle-package-original
128+
129+
.. include:: /includes/query-conversion-examples/oracle-package-original.rst
130+
131+
.. tab:: Javascript
132+
:tabid: oracle-package-js
133+
134+
.. include:: /includes/query-conversion-examples/oracle-package-js.rst
135+
136+
.. tab:: C#
137+
:tabid: oracle-package-csharp
138+
139+
.. include:: /includes/query-conversion-examples/oracle-package-csharp.rst
140+
141+
.. tab:: Java
142+
:tabid: oracle-package-java
143+
144+
.. include:: /includes/query-conversion-examples/oracle-package-java.rst
145+

source/code-generation/query-converter/convert-stored-procedures.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Convert Stored Procedures
1111
:class: singlecol
1212

1313
You can import and convert your SQL stored procedures to MongoDB code
14-
with the query converter. The query converter considers the mapping
15-
rules and schema transformations defined in your project when converting
16-
your SQL code.
14+
with the query converter. If you are migrating from Microsoft SQL Server,
15+
you can also import and convert SQL Server functions. The query converter
16+
considers the mapping rules and schema transformations defined in your project
17+
when converting your SQL code.
1718

1819
About this Task
1920
---------------
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
You can use the :guilabel:`Filter` text box to filter queries,
2-
stored procedures, triggers, and views based on object name and SQL
3-
syntax.
2+
stored procedures, triggers, packages, and views based on object
3+
name and SQL syntax.
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
- The query converter uses AI technology which may not be able to
2-
convert long or complex queries, triggers, or stored procedures.
3-
Some queries may not be converted correctly while others may not
4-
be converted at all.
2+
convert long or complex queries, triggers, packages, or stored
3+
procedures. Some queries may not be converted correctly while
4+
others may not be converted at all. For more information, see
5+
:ref:`<rm-ai-and-data-usage>`.
56

67
- The query converter uses the relational schema, the MongoDB schema,
78
and the mapping rules in your current project to determine how the
89
queries should be converted. Conversions may fail or be incorrect if
910
the queries reference tables that are not in your relational schema
1011
or if they are not mapped to MongoDB collections.
1112

12-
- Converted queries, triggers, views, and stored procedures are saved in
13-
your project and persist through project import and exports.
13+
- Converted queries, triggers, views, packages, and stored procedures
14+
are saved in your project and persist through project import and
15+
exports.
1416

1517
- SQL queries are limited to 40,000 text characters.

0 commit comments

Comments
 (0)