The following series of panels show each stage of using advanced
SELECT prototyping to build an SQL statement to show all rows of the
table PARTS.
Select option 2 (Advanced) from the SQL Prototyping and Execution
panel to display the initial Advanced SELECT Prototyping panel.
Move the cursor to the fullselect fragment.
Press Enter. The syntax for the full SELECT clause is displayed.
Move the cursor to the subselect fragment.
Press Enter. The syntax for the subselect clause is displayed.
Notice that the select and from fragments
are displayed on your screen in red indicating that the subsections
relating to these fragments must be completed before these fragments
can be resolved.
Move the cursor to the select fragment.
Press Enter. The syntax for the SELECT clause is displayed.
The panel now shows the partly-built SELECT statement:
SELECT ALL
This is because:
The keyword SELECT is a required keyword for this fragment. As
you have selected this fragment, FM/Db2 has entered it into the SELECT
statement.
ALL is a default keyword (and, in this case, what you want).
Move the cursor to the asterisk (*).
Press Enter.
The panel now shows the partly-built SELECT statement:
SELECT ALL *
Press the Exit function key (F3). The syntax for the subselect
clause is displayed.
Notice that the select fragment has now changed
on your screen from red to green indicating that the subsection
relating to this fragment has been completed and this fragment can
be resolved.
You now need to complete the subsection relating
to the from fragment.
Move the cursor to the from fragment.
Press Enter. The syntax for the FROM clause is displayed.
The panel now shows the partly-built SELECT statement:
SELECT ALL * FROM
This is because the keyword
FROM is a required keyword.
Again, notice that the tabref fragment
is displayed on your screen in red, indicating that the subsection
relating to this fragment is yet to completed before this fragment
can be resolved
Move the cursor to the tabref fragment.
Press Enter. The syntax for the table specification clause is
displayed.
Move the cursor to the table fragment.
Press Enter. A panel is displayed in which you can enter a table
name.
Type PARTS in the panel.
Press the Exit function key (F3). The syntax for the table specification
clause is displayed.
The panel shows the completed SELECT statement:
SELECT ALL * FROM PARTS
Notice
that the table fragment has now changed on your screen from
red to green, indicating that the subsection relating to this
fragment has been completed and the fragment can be resolved. Also
notice that the status indicator (Status:) shows “statement
complete”.