Choose an existing SQL statement

When you save SQL statements in a command file, 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, the following figure lists the command files that are included in the demonstration database.
Figure 1. 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 in the current directory and in any directories that the DBPATH environment variable specifies.
Important: This list includes only those file names that have the .sql extension. If you create an SQL file outside of DB-Access and save it without the .sql extension, the files does not show in the list of files to choose.
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 that you have command files, exit DB-Access, change directories to the directory that contains your .sql files, and restart DB-Access.

Copyright© 2019 HCL Technologies Limited