One of the principal uses of dbisqlc is to look at information in databases.
The database used in this tutorial is for a fictional company. The sample database contains information about employees, departments, sales orders, and so on.
All this information is organized into a number of tables, consisting of rows and columns.
Sybase IQ provides a number of built-in functions called system stored procedures to display information about your database.
For example, you can list the tables in the sample database using the sp_iqtable stored procedure. To run a stored procedure, type its name (and any parameters) in the Command window.
For more information about system stored procedures, see Chapter 10, “System Procedures” in the Sybase IQ Reference Manual.
To list the data stored within database tables, type a SELECT command in the dbisqlc command window. Once you have typed the command, choose the F9 function key (if supported) or Command > Execute from the menu to carry out the command. The example output that follows displays the first several columns and rows of the results of the query. (These appear in the dbisqlc data window.) The format is used throughout this manual.
Type the following:
SELECT * FROM employee
emp_id |
manager_id |
emp_fname |
emp_lname |
... |
---|---|---|---|---|
102 |
501 |
Fran |
Whitney |
... |
105 |
501 |
Matthew |
Cobb |
... |
129 |
902 |
Philip |
Chin |
... |
148 |
1293 |
Julie |
Jordan |
... |
160 |
501 |
Robert |
Breault |
... |
... |
|
|
|
SQL statements are case insensitive. SELECT is the same as select and the same as Select. In the examples, SQL keywords are shown in upper case, but you do not have to type them in upper case.
SQL statements can be typed on more than one line. You can type the statements all on one line, or break them over several lines as you wish. Some SQL statements, such as the SELECT statement, consist of several parts, called clauses. In many examples, each clause is placed on a separate line, but you do not have to type them this way.
The dbisqlc Data window displays a set of rows and columns containing information about the employees. Each row contains information about one employee, and each column contains a particular piece of information for all employees.