ADD QUERY Clause

Description

You can add a new query to a query specification by using the ADD QUERY clause of the ALTER  VIEW statement. 1 is assigned to the query defined when a virtual table was created, and 2 is assigned to the query added by the ADD QUERY clause.

Syntax

ALTER [ VIEW | VCLASS ] view_name

ADD QUERY select_statement

[ INHERIT resolution [ {, resolution }_ ] ]

 

resolution :

{ column_name | method_name } OF superclass_name [ AS alias ]

Example

SELECT * FROM b_view;

 

           id  phone

===================================

            1  '111-1111'

            2  '222-2222'

            3  '333-3333'

            4  NULL

            5  NULL

 

 

ALTER VIEW b_view ADD QUERY SELECT * FROM a_tbl WHERE id IN (1,2);

SELECT * FROM b_view;

 

           id  phone

===================================

            1  '111-1111'

            2  '222-2222'

            3  '333-3333'

            4  NULL

            5  NULL

            1  '111-1111'

            2  '222-2222'