Create view for columns : Matadata « Command MySQL « SQL / MySQL






Create view for columns

    
mysql>
mysql> CREATE   OR REPLACE VIEW COLUMNS
    ->         (TABLE_CREATOR, TABLE_NAME, COLUMN_NAME,
    ->          COLUMN_NO, DATA_TYPE, CHAR_LENGTH,
    ->         `PRECISION`, SCALE, NULLABLE, COMMENT) AS
    -> SELECT   UPPER(TABLE_SCHEMA), UPPER(TABLE_NAME),
    ->          UPPER(COLUMN_NAME), ORDINAL_POSITION,
    ->          UPPER(DATA_TYPE), CHARACTER_MAXIMUM_LENGTH,
    ->          NUMERIC_PRECISION, NUMERIC_SCALE, IS_NULLABLE,
    ->          COLUMN_COMMENT
    -> FROM     INFORMATION_SCHEMA.COLUMNS;
Query OK, 0 rows affected (0.01 sec)

mysql>

   
    
    
    
  








Related examples in the same category

1.Create view for base table and temporary table
2.Create view for view information from INFORMATION_SCHEMA.VIEWS
3.Create view for column information
4.Create view for user authentication
5.Create view for database authentication
6.Create view on table Privileges
7.Create view for Column Privileges