| Home | Previous Lesson: Interactive SQL from the DB Painter Next Lesson: Query Plan |
If you don't see ISQL sheet, display it by selecting 'View > Interactive SQL' menu option. Let us write a query to select from units table and execute it. Type the following SQL statement in the ISQL sheet.
SELECT "units"."unit ",
"units"."unit_description"
FROM "units"
WHERE "units"."unit " = 'U' ;
In this sheet, you need to terminate SQL statements with a semicolon. A single SQL statement can span on multiple lines. When the SQL Statement is written on multiple lines only the last line needs to be terminated with a semicolon.
Please notice the single quotations around 'U' in the query. For some databases such as Sybase SQL Server/MS SQL Server, it doesn't matter which quotations you use. But, for Watcom SQL/Adaptive Server Anywhere, you have to use single quotations. Double quotations are for columns or tables/view names. In MS SQL Server, from version 6.0 onwards use appropriate quotations i.e. use double quotations so that SQL Server interprets the special characters before it runs the query. If you don't want SQL Server to interpret the special characters within the quotations use single quotations.
To execute the SQL Statements select Design > Execute ISQL menu option or click on
icon.
| Home | Previous Lesson: Interactive SQL from the DB Painter Next Lesson: Query Plan |