Keep your queries aside. So you can use them another day.
For saving a query using the SQL Editor, select the query and click on the save icon as shown below.
The given SQL query is tested by the system before saving. The user is notified of errors in the query, if any. This ensures that only valid SQL queries are saved in the catalog.
SQL Queries saved in the catalog can be refered in the resource files using the ref attribute of the Sql tag.
For example, a saved SQL with reference ID 38 can be referred as shown below
<Sql id="ref_example" ref="38" />
This allows the same SQL to be reused in multiple resource files.
If SQL queries containing request parameters are to be saved, the console will prompt the user to enter test data inputs for each request variable.
The SQL query is executed on the connected database with the test data inputs in place of the request parameters. On successful execution, the query is saved.