Creating the SQL File
From the [New] wizard, select [SQL Development] > [SQL File]. Refer below for the contents to specify in the wizard:
Database server type
Select a database product and version combination.
Connection profile name
The connection profiles for the database server type are listed. Select from the list.
Database name
The databases to which the connection profile connect are listed. Select from the list.
[Create] button
A connection profile can be created. For details on connection profiles, refer to "8.3.1 Connecting to the Database".
Point
An SQL file can be created without selecting a database server type, connection profile name, and database name. However, if these are not set, some editor support functions may not be available.
Editing the SQL File
Use the SQL File editor to open the SQL file. Code SQL statements in the SQL file.
If connected to the database, content assist can be used to enter tables and columns.
Point
Specify a semicolon (;) as the delimiter between SQL statements. For some SQL statements, this delimiter cannot be parsed. In those cases, enter a line feed at the end of the SQL statement and specify a semicolon at the start of the next line. Alternatively, code the SQL statement in one line.
Executing SQL Files
Check the [Connection profile] group shown in the SQL File editor. Check that values are set in the type, name, and database combo boxes and that the database is connected.
From the context menu of the SQL File Editor, select one of the items below. The SQL statement described in the SQL file is executed, and the result is displayed in the [SQL Results] view.
[Execute All]
Splits all text with a ";" (semicolon) or GO delimiter, and then executes the SQL statement.
[Execute Selected Text]
Splits the selected text with a ";" (semicolon) or GO delimiter, and then executes the SQL statement.
[Execute Selected Text As One Statement]
Executes the selected text as one SQL statement.
[Execute Current Text]
Executes the SQL statement where the cursor is currently positioned.
Point
The operation of [Execute Current Text] follows the settings in the workbench settings window, [Data Management] > [SQL Development] > [SQL Editor] under [Execute current text]. The default setting is [Execute current line].
Execute SQLs between delimiters
Executes the SQL between the delimiters before and after where the cursor is currently positioned.
Execute current line
Executes the text in the line where the cursor is positioned.
Execute SQLs between blank lines
Executes the SQL between the blank lines before and after where the cursor is currently positioned.