Home | Previous Page | Next Page   The Query-language Option >

Choosing an Existing SQL Statement

When you save SQL statements in a command file, as described in Saving the Current SQL Statement, you can retrieve the command file and run or edit the SQL statements at any time.

Select the Choose option on the SQL menu to display the CHOOSE screen with a list of the command files that you can access. These files have the extension .sql, although the extension is not shown. For example, Figure 19 lists the command files included in the demonstration database.

Figure 19. The CHOOSE Screen Listing Current .sql Files
CHOOSE >> 
Choose a command file with the Arrow Keys, or enter a name, then press Return.

---------------- mystores@dbserver1 ----------- Press CTRL-W for Help ------- 

 alt_cat              c_state            d_trig             sel_ojoin1

c_calls             c_stock            d_view             sel_ojoin2

c_cat               c_stores           del_stock          sel_ojoin3

c_custom            c_table            ins_table          sel_ojoin4

c_index             c_trig             opt_disk           sel_order

c_items             c_type             sel_agg            sel_sub

c_manuf             c_view1            sel_all            sel_union

c_orders            c_view2            sel_group          upd_table

c_proc              d_proc             sel_join

If no current database exists, the list includes all the command files located in the current directory and in any directories that the DBPATH environment variable specifies.

Important:
This list includes only those filenames that have the .sql extension. If you create a new SQL file outside of DB–Access and save it without the .sql extension, it will not appear in the list of files to choose. Add the .sql extension to the filename and then select Choose again.

Note:
DB–Access can only recognize files that are stored in the directory from which you started DB–Access. If the Choose command results in an empty list, and you know you have command files, exit DB–Access, change directories to the directory that contains your .sql files, and restart DB–Access.

To select a command file, use the arrow keys to highlight its name or enter the name of the file at the prompt.

When the SQL menu reappears, it displays the command file statements on the screen as the current statements. To modify, run, edit, or output these statements, choose the appropriate menu option.

To leave the CHOOSE screen without selecting a command file, press the Interrupt key, which returns you to the SQL menu.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]