Convert Queries
On this page
You can convert embedded application and reporting SQL queries to MongoDB syntax using the query converter. Copy and paste your queries into the query converter to update them to work with MongoDB and your migrated schema.
About this Task
The query converter uses AI technology which may not be able to convert long or complex queries, triggers, packages, or stored procedures. Some queries may not be converted correctly while others may not be converted at all. For more information, see AI and Data Usage Information.
The query converter uses the relational schema, the MongoDB schema, and the mapping rules in your current project to determine how the queries should be converted. Conversions may fail or be incorrect if the queries reference tables that are not in your relational schema or if they are not mapped to MongoDB collections.
Converted queries, triggers, views, packages, and stored procedures are saved in your project and persist through project import and exports.
SQL queries are limited to 40,000 text characters.
Always review and test the code generated by query converter before deploying it in a production environment.
You can view the history of previous conversions in the left-hand Query Converter pane. Each conversion has an icon indicating the result of the conversion. If an object does not have an icon next to it, a conversion has not been attempted yet:
IconDescriptionSpinner
The conversion is now being executed.
Green check mark
The conversion was successful.
Red exclamation mark
The conversion failed on last attempt.
Steps
Select a target language
Use Target Language to select a language for the query converter to render.
Note
If you use Java, you can also select Return a domain object where possible. When selected, the query converter includes strongly typed Java entities based on POJO classes if the query only operates on a single MongoDB collection.
Convert and test syntax
Click the Convert button. Wait for your SQL code to converted. The converted MongoDB syntax code displays in the Converted MongoDB Query pane.
If the query converter has errors, you can view the details in the Converted MongoDB Query pane.
Tip
To rename or delete queries from your project, click the button on the SQL Query pane and select the or icon.
Click the icon to copy the MongoDB syntax to your clipboard.
Test and validate the generated MongoDB syntax.
Tip
You can use the Filter text box to filter queries, stored procedures, triggers, packages, and views based on object name and SQL syntax.
Examples
The following table shows examples of SQL queries converted to MongoDB syntax using query converter. The syntax and structure of the converted queries vary depending on the mapping rules used in the project:
SQL Syntax | MongoDB Syntax | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| ||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||
|
|