Netezza Create View Syntax

Reading Time: < 1 minute

Utilize the create view statement to create a virtual table based on the result-set of a complex SQL statement that may have multiple table joins or a simple SELECT statement with selected columns that are needed to be viewed by the analyst group. Netezza Views are read-only. The system does not allow you an insert, update, or delete on a view.

Netezza Create View Syntax

Syntax for creating a view:

CREATE <OR REPLACE> VIEW <view_name> AS SELECT <query>;

Other databases like Teradata supports creating RECURSIVE VIEW but Netezza does not supports RECURSIVE view creation,

Netezza check View if it is not obsolete

If you alter or change the underlying view table then that view will become obsolete and not usable until you re-compile that. IBM has provided the script that will allow you to check if view is obsolete. Generally, script is available at /nz/support/bin location. Ask your Netezza admin team for exact location. Below is the script and its usage:

nz_check_views [ database ] [-replace <flag>]