Netezza的信息架构(INFORMATION_SCHEMA)

时间:2015-05-27 00:14:21

标签: netezza information-schema

我长期以来一直在使用INFORMATION_SCHEMA.COLUMNS for MS SQL,并且一直是我最好的朋友之一。我的公司正在将其平台改为Netezza。在Netezza中是否存在相关内容,我可以通过查询查询和查找Netezza中的列/表。

谢谢

1 个答案:

答案 0 :(得分:1)

您可以使用用户和系统视图来使用SQL访问此信息,如下所示:

select * from _v_table where objtype = 'TABLE';
  OBJID  | TABLENAME | OWNER |     CREATEDATE      | OBJTYPE | OBJCLASS | DESCRIPTION | RELHASINDEX | RELKIND | RELCHECKS | RELTRIGGERS | RELHASRULES | RELUKEYS | RELFKEYS | RELREFS | RELHASPKEY | RELNATTS | RELDISTMETHOD | OBJDELIM | RELTUPLES | BASEOBJID | VISIBLEID | RELVERSION | RELORIGOID | DATABASE |  OBJDB  | SCHEMA | SCHEMAID
---------+-----------+-------+---------------------+---------+----------+-------------+-------------+---------+-----------+-------------+-------------+----------+----------+---------+------------+----------+---------------+----------+-----------+-----------+-----------+------------+------------+----------+---------+--------+----------
 1249610 | TABLE_A   | ADMIN | 2015-04-13 19:33:48 | TABLE   |     4905 |             | f           | r       |         0 |           0 | f           |        0 |        0 |       0 | f          |        2 |          6005 | f        |         0 |   1249610 |   1249610 |          0 |    1249610 | MY_TEST  | 1249609 | SCOTT  |  1249608
(1 row)



select * from _v_relation_column where name = 'TABLE_A';
      OBJID  |  NAME   | OWNER |     CREATEDATE      | TYPE  | DATABASE | ATTNUM | ATTNAME |  COLID  | DESCRIPTION |      FORMAT_TYPE      | ATTNOTNULL | ATTTYPID | ATTTYPMOD | ATTLEN | ATTDISPERSION | COLDEFAULT | ATTCOLLENG | ATTDELIM | ZMAPPED | OBJCLASS | RELRESTOREDOID | OBJDELIM | ATTVERSTATUS | ATTORIGOID | ATTRESTOREDOID |  OBJDB  | SCHEMA | SCHEMAID
    ---------+---------+-------+---------------------+-------+----------+--------+---------+---------+-------------+-----------------------+------------+----------+-----------+--------+---------------+------------+------------+----------+---------+----------+----------------+----------+--------------+------------+----------------+---------+--------+----------
     1249610 | TABLE_A | ADMIN | 2015-04-13 19:33:48 | TABLE | MY_TEST  |      1 | COL1    | 1596671 |             | BIGINT                | f          |       20 |        -1 |      8 |             0 |            |          8 | f        | t       |     4905 |              0 | f        |            0 |          0 |              0 | 1249609 | SCOTT  |  1249608
     1249610 | TABLE_A | ADMIN | 2015-04-13 19:33:48 | TABLE | MY_TEST  |      2 | COL2    | 1596672 |             | CHARACTER VARYING(20) | f          |     1043 |        32 |     -1 |             0 |            |         20 | f        | f       |     4905 |              0 | f        |            0 |          0 |              0 | 1249609 | SCOTT  |  1249608
    (2 rows)

这些观点和其他are documented here