Formatting SQL statements in Java files from the Package Explorer

You can format pureQuery SQL statements in Java files from the Package Explorer.

Before you begin

Ensure your project meets the following requirements:
  • The Java project that contains the Java file must have pureQuery support enabled.
  • The SQL statements that you want to format must have pureQuery annotation.

About this task

If a file that contains SQL statements is open in the Java editor, you can format the statements directly in the editor.

Procedure

To format SQL statements in a Java file from the Package Explorer:

In the Package Explorer, right-click the Java file (.java) that contains the SQL statements, and then select pureQuery > Format SQL.

Results

All of the pureQuery SQL statements in the Java file are formatted. If the file is open in a Java editor, the code in the editor is refreshed to show the SQL statements formatted.

Feedback