GBase 8a supports views. When a view is created, every table or other view it references must exist; if one of them is dropped later, querying the view fails. The China-domestically developed GBase 8a MPP database from GBASE provides check table to verify whether a view's references are still valid.
Syntax
check table [ vc . ] [ db . ] VIEW_NAME
Enter fullscreen mode
Exit fullscreen mode
Example
The sample below creates a view, drops the table behind it, and compares the check table output before and after:
gbase> create table a(id int); Query OK, 0 rows affected (Elapsed: 00:00:00.07)
gbase> insert into a values(8); Query OK, 1 row affected (Elapsed: 00:00:00.07)
gbase> select * from a; +------+ | id | +------+ | 8 | +------+ 1 row in set (Elapsed: 00:00:00.02)
gbase> create view v_a as select * from a; Query OK, 0 rows affected (Elapsed: 00:00:00.06)
gbase> select * from v_a; +------+ | id | +------+ | 8 | +------+ 1 row in set (Elapsed: 00:00:00.02)
gbase> check table v_a;…