Data in the system tables is only viewable by querying the system views; you cannot query a system table directly. With a few exceptions, each system table has a corresponding view.
The system views are named similar to the system tables, but without an I at the beginning. For example, to view the data in the ISYSTAB system table, you query the SYSTAB system view.
For a list of views provided in SQL Anywhere and a description of the type of information they contain, see System views.
You can either use Sybase Central or Interactive SQL to browse system view data.
Connect to the database as a user with DBA authority.
In the left pane, double-click Views.
Select the view corresponding to the system table.
In the right pane, click the Data tab.
Connect to the database as a user with DBA authority.
Execute a SELECT statement that references the system view corresponding to the system table.
Suppose you want to view the data in the ISYSTAB system table. Since you cannot query the table directly, the following statement displays all data in the corresponding SYSTAB system view:
SELECT * FROM SYS.SYSTAB; |
Sometimes, columns that exist in the system table do not exist in the corresponding system view. To extract a text file containing the definition of a specific view, use a statement such as the following:
SELECT viewtext FROM SYS.SYSVIEWS WHERE viewname = 'SYSTAB'; OUTPUT TO viewtext.sql FORMAT TEXT ESCAPES OFF QUOTE ''; |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |