CREATE SQL VIEW Command Example

The following example opens the testdata database. CREATE SQL VIEW is used to create a local SQL view named myview which is created from a SELECT – SQL statement that selects all records from the customer table. The View Designer is displayed, allowing you to modify the SQL view. After the View Designer is closed, the SQL view is erased.

CLOSE DATABASES
* Open testdata database
OPEN DATABASE (HOME(2) + 'data\testdata')

* Create view with initial select criteria from customer table
CREATE SQL VIEW myview AS SELECT * FROM testdata!customer;
   WHERE country="Mexico"

* Activate View Designer to modify or run query
MODIFY VIEW myview  &&Activates View Designer

* Delete view after View Designer closes
DELETE VIEW myview