The prompt function helps you supply the necessary information for the syntax of the statement you want to use. The prompt function can be used in any of these statement processing modes: *RUN, *VLD, and *SYN.
You have two options when using the prompter:
The statement is parsed and the clauses that are completed are filled in on the prompt displays.
If you type SELECT and press F4=Prompt, the following display appears:
Specify SELECT Statement Type SELECT statement information. Press F4 for a list. FROM tables . . . . . . . . _____________________________________________ SELECT columns . . . . . . _____________________________________________ WHERE conditions . . . . . _____________________________________________ GROUP BY columns . . . . . _____________________________________________ HAVING conditions . . . . . _____________________________________________ ORDER BY columns . . . . . _____________________________________________ FOR UPDATE OF columns . . . _____________________________________________ Bottom Type choices, press Enter. DISTINCT rows in result table . . . . . . . . . N Y=Yes, N=No UNION with another SELECT . . . . . . . . . . . N Y=Yes, N=No Specify additional options . . . . . . . . . . . N Y=Yes, N=No F3=Exit F4=Prompt F5=Refresh F6=Insert line F9=Specify subquery F10=Copy line F12=Cancel F14=Delete line F15=Split line F24=More keys
If you press F4=Prompt without typing anything, the following display appears:
Select SQL Statement Select one of the following: 1. ALTER TABLE 2. CALL 3. COMMENT ON 4. COMMIT 5. CONNECT 6. CREATE ALIAS 7. CREATE COLLECTION 8. CREATE INDEX 9. CREATE PROCEDURE 10. CREATE TABLE 11. CREATE VIEW 12. DELETE 13. DISCONNECT 14. DROP ALIAS More... Selection __ F3=Exit F12=Cancel
If you press F21=Display Statement on a prompt display, the prompter displays the formatted SQL statement as it was filled in to that point.
When Enter is pressed within prompting, the statement that was built through the prompt screens is inserted into the session. If the statement processing mode is *RUN, the statement is run. The prompter remains in control if an error is encountered.