Tutorial: Creating and Executing SQL Against IMS
Goal
Author SQL and execute it against a selected IMS database connection.
Steps
- In your IMS project within the IMS Projects view, create or open a
.sqlfile using the Add SQL file option. This button is indicated by a file with a plus symbol.
You can write your own SQL query with assistance from the IMS Explorer extension, or paste in a prepared query.
- Select the IMS Connection button from the status bar to target the desired database for your SQL query.
- Execute the SQL from the editor. This can be done in the following ways:
- Clicking the extension's execute SQL action, located in the top-right of the SQL editor
- Right-click in the SQL editor and select Run All SQL in File
- Highlight a portion of SQL you wish to execute and right-click, select Run Selected SQL query
- Select your IMS database connection to execute your SQL query on.
A notification is given indicating SQL has been executed. Upon completion of the results, the SQL query history view opens with the query status.
Tips
- Use table views and object browsing to confirm column/segment names before running queries.
- If a SQL query does not complete or if a connection is not found, ensure that a valid IMS database connection has been selected. If problems persist, check the IMS Explorer extension notifications during execution of the SQL query or consult console logs for further troubleshooting.