How it works...

The view created in the recipe will be retrieving rows from the underlying tables. And WHERE in SELECT will be limiting the number of rows. 

The maximum number of columns in a view can be equal to 2,048.

Any view that gets created needs be given select access to base tables, without it your select will error out, giving the error The owner referenced by user does not have insert with GRANT Option.

Following is the statement to give GRANT:

/* Grant on view*/grant select,insert on <tablesdb> to <viewsdb> with grant option;

The thing to note here is that the actual view doesn't store any rows in it like a table. The following are some best practices that you must follow when creating views:

  • Specify a locking statement like the ...

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.