Previous | Contents | Index |
GQL displays the Output Options menu from which you can select where you want to print the report. SCREEN is the default option.
Example 2-10 Report Output Options Menu |
---|
+----------------- Output Options -----------------+ | Screen | Laser Printer | Exit | | Printer Port | Email | | | System Printer | Save to Disk | | +--------------------------------------------------+ |
Select the Screen option to print the report on the screen.
The completed sample report is displayed.
14-Jan-1999 CLIENT LIST Page 1 CLNT Last First ID Name Name City ----- ----------------- --------------- ------------------------- 80542 Brock Bud Duluth 80543 Cass Cathy 80561 Derringer Dale 80522 Errant Earl 80573 Farmer Fred Miami 80544 Porter Press the RETURN key to continue |
After reviewing the report, press the [RETURN] key to return to the Output Options menu.
Use the arrow keys to select the EXIT option and press [RETURN].
You will be returned to the Guide Options menu.
+--------------------------------Guide Options---------------------------------+ | TITLE OPEN RELATE SELECT SORT PRINT GO EDIT MORE >>| +------------------------------------------------------------------------------+ |
You have now completed your first Guided Query Language report.
At this point, you can EITHER exit out of the Guided Query Language OR proceed to the next chapter for further instruction. |
2.7 Exiting GQL
If you wish to exit the GQL menu interface, move the arrow key to the
right until the exit option is displayed.
+--------------------------------Guide Options---------------------------------+ |<< OPEN RELATE SELECT SORT PRINT GO EDIT MORE exit | +------------------------------------------------------------------------------+ |
Select the exit option.
You are now out of the GQL menu interface and at the Guide prompt.
Guide> Menu interface has been turned off EXIT = Exit INTOUCH Guided Query Language HELP = Help |
Type the word EXIT.
Guide> EXIT |
You will be out of the Guided Query Language and at the system prompt ($).
In the previous chapter, you created a sample report using GQL commands.
If you created the sample report as instructed in the previous chapter and then EXITed out of GQL, you will need to re-create the sample report before proceeding unless you SAVEd the sample report. |
As each of the report commands was created, GQL stored the command in a temporary file.
The temporary file now contains all of the GQL commands which create the sample report, "CLIENT LIST".
Let us say that we want to change the sample report to print first name, last name instead of last name, first name and also add the state.
We can make report changes by editing the temporary file which contains the GQL commands.
3.1 Editing the Report File
To see what the GQL commands look like and to make changes, GQL prompts
us to select the EDIT option from the Guide Options
menu.
+--------------------------------Guide Options---------------------------------+ | TITLE OPEN RELATE SELECT SORT PRINT GO EDIT MORE >>| +------------------------------------------------------------------------------+ |
Select the EDIT option.
When you select the EDIT option, you are put into edit mode. This allows you to make changes to the GQL commands.
The GQL commands for the "CLIENT LIST" report are displayed.
Example 3-1 GQL Command File Example |
---|
SET MENU ON TITLE "CLIENT LIST" OPEN CLIENT INCLUDE CLIENT(ID) > "80500" SORT CLIENT(LAST) ASCENDING PRINT CLIENT(ID) PRINT CLIENT(LAST) PRINT CLIENT(FIRST) PRINT CLIENT(CITY) [End of file] Buffer: GUIDE_EDIT_050002.TMP | Write | Insert | Forward 9 lines read from file USER:[TESTER]GUIDE_EDIT_050002.TMP;3 |
You can see that the GQL commands consist of key words such as TITLE, OPEN, INCLUDE, SORT, PRINT, etc. As you become familiar with the GQL commands, you will be able to write your own commands at the Guide prompt. For example, you could have typed in the following commands at the Guide prompt and created the exact same "CLIENT LIST" report that we created using the GQL menus.
Guide> TITLE CLIENT LIST Guide> OPEN CLIENT Guide> INCLUDE CLIENT(ID) > "80500" Guide> SORT CLIENT(LAST) Guide> PRINT CLIENT(ID) Guide> PRINT CLIENT(LAST) Guide> PRINT CLIENT(FIRST) Guide> PRINT CLIENT(CITY) |
We will now edit the temporary GQL report command file and make a change so the first name prints before the last name (e.g FIRST, LAST) on the "CLIENT LIST" report.
Using the editor, move the line which contains the FIRST field above the line which contains the LAST field.
The file will then appear as follows:
SET MENU ON TITLE "CLIENT LIST" OPEN CLIENT INCLUDE CLIENT(ID) > "80500" SORT CLIENT(LAST) ASCENDING PRINT CLIENT(ID) PRINT CLIENT(FIRST) <--- changed line PRINT CLIENT(LAST) <--- changed line PRINT CLIENT(CITY) [End of file] |
After you have changed the line, exit out of edit mode. This will take you back to the Guide Options menu.
The report format is displayed and shows that the first and last names have been switched.
CLIENT LIST Pos: 65 CLNT First Last ID Name Name City ----- --------------- ----------------- ------------------------- XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXX |
Now, we want to include the state on the report.
To add the state field to our report, perform the following steps:
The report display shows that the state has been added to the report.
Select the GO option to run the report.
The changed report will appear as follows:
14-Jan-1999 CLIENT LIST Page 1 CLNT First Last ID Name Name City ST ----- --------------- ----------------- ------------------------- -- 80542 Bud Brock Duluth MN 80543 Cathy Cass CA 80561 Dale Derringer CA 80522 Earl Errant CA 80573 Fred Farmer Miami FL 80544 Porter Press the RETURN key to continue |
The "CLIENT LIST" report has been changed. Now, we want to save the report so that it can be run at another time.
3.2 Saving the Report File
To save the temporary GQL command file which creates the "CLIENT LIST"
report, first, get back to the Guide Options menu.
Move the arrow keys to the right and select the MORE option.
Example 3-2 MORE submenu |
---|
+--------------------------------Guide Options---------------------------------+ | TITLE OPEN RELATE SELECT SORT PRINT GO EDIT MORE >>| +------------------------------------------------------------------------------+ +-----MORE-----+ | SAVE | | HELP | | BREAK | | SUMMARY | | INPUT | | ... | +--------------+ |
You will see that SAVE is one of the items on the MORE submenu.
Use the arrow keys to select the SAVE option.
You are now at the Guide prompt and GQL is asking you to enter a command file name. This is the name you want to give to the temporary file that creates the "CLIENT LIST" report. GQL provides the default name of sys$login:guide.guide.
Guide_save> SAVE sys$login:guide.guide |
We will use the name CLIENT_LIST for our command file name.
Type CLIENT_LIST at the Guide prompt.
Guide_save> SAVE CLIENT_LIST |
Using the command file name we provided, GQL saves the temporary command file on disk. The extension .guide is appended to the name we provided.
Commands saved in CLIENT_LIST.guide |
You can now check your directory to see if the report command file was saved.
Previous | Next | Contents | Index |