Collection Contents Index CHAPTER 18.  System Tables The SYSCOLUMNS table pdf/chap18.pdf

First Guide to SQL Anywhere Studio
   PART 3. Basic SQL
     CHAPTER 18. System Tables       

The SYSCATALOG table


The first system table lists all the tables in the database.

  To view the contents of the SYSCATALOG table for the sample database:
  1. Type the following command:

    SELECT *
    FROM sys.syscatalog

    The first screen of tables lists some of the system tables found in Adaptive Server Anywhere.

  2. Scroll through the Interactive SQL data window a few times, you will see the tables that make up the company database.

The owner of the system tables 

The owner of the system tables is the special user ID, SYS and the owner of the company tables is dba. In addition, there is a set of views owned by the special user ID DBO, which provide an emulation of the Sybase SQL Server system catalog; these tables are not discussed in this section.

Recall that dba is the user ID you used when connecting to the database from Interactive SQL. So far, you have simply typed the table names employee and department; SQL looked in SYSCATALOG for tables with those names created by dba. In this example, by typing SYS.SYSCATALOG you specified that SYSCATALOG was created by the user ID SYS. Note the similarity to the way column names are qualified, such as employee.emp_id.

Other columns in the system table 

The other columns in this table contain other important information. For example, the column named Ncols is the number of columns in each table, and the column named tabletype identifies the table as a permanent table (also called a base table) or a view.


Collection Contents Index CHAPTER 18.  System Tables The SYSCOLUMNS table pdf/chap18.pdf