Creating SQL and XQuery statements in the SQL and XQuery editor by using the File menu

You can use the File menu to create SQL and XQuery statements in the SQL and XQuery editor.

The SQL and XQuery editor supports any statement that can be run by the database to which you are connected. The statement that you create is stored in a file with the extension .sql.

Prerequisite: Before you create an SQL or XQuery statement by using the File menu, create a data development project in the Data Project Explorer view.

To create an SQL statement in the SQL and XQuery editor by using the File menu:

  1. Open the Data perspective.
  2. Click File > New > Other, and then in the New wizard, select SQL or XQuery Script and click Finish.
  3. Complete the New SQL or XQuery Script wizard, leaving SQL and XQuery editor selected.
  4. Click Finish. The statement is added to the SQL Scripts folder of the data development project that you selected in the wizard. The statement opens in the SQL and XQuery editor.
  5. Complete the SQL or XQuery statement.
  6. Optional: To insert the code pattern of a template into your statement, at the insertion point, type the first few characters of the template name, press Ctrl + Space, and then select the template in content assist.
  7. Optional: To format your SQL or XQuery code, right-click in the editor, and then click Format SQL on the pop-up menu.
  8. Save the statement.

Feedback