Navigation

Portable SQL : Statements : Access metadata : Views

From Linuxnetworks

< Portable SQL
Revision as of 11:35, 3 May 2008 by Nose (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

Contents

[edit] ANSI

SQL-92 defines a collection of objects in INFORMATION_SCHEMA which contains the list of available views:

SELECT table_name
FROM information_schema.views

[edit] Firebird/Interbase

SELECT DISTINCT RDB$VIEW_NAME
FROM RDB$VIEW_RELATIONS

[edit] MS SQL Server

SELECT name
FROM sys.views

[edit] MySQL

Fully compatible with SQL-92.

[edit] Oracle

SELECT view_name
FROM user_views

[edit] PostgreSQL

SELECT table_name
FROM information_schema.views
WHERE
 table_name !~ '^pg_' AND
 table_schema NOT IN ('pg_catalog', 'information_schema')

[edit] SQLite

Doesn't support retrieving views via an SQL statement.

[edit] Sybase ASE

EXEC sp_tables @table_type = "'VIEW'", @table_owner = "dbo"
< Portable SQL
Revision as of 11:35, 3 May 2008 by Nose (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)