ODBC Server Reference Manual

Using Pass-Through Mode
HP NonStop ODBC Server Reference Manual429151-002
6-18
Creating or Altering Views
Altering Table Attributes
When you create a table using the CREATE TABLE statement, the table is created with
NonStop SQL/MP default attributes. You can change the attributes, however, by
altering the table in pass-through mode:
select "tdm: sql alter table $vol3.prsntabs.employee
secure 'cc-u' "
select "tdm: sql alter table $vol3.prsntabs.dept
nopurgeuntil jan 01 1995
no audit"
You do not need to update the mapping tables after altering table attributes.
Creating or Altering Views
The following examples show how to use pass-through mode to create or alter views.
Creating a Protection or Shorthand View
When you create a view using the SQL statement CREATE VIEW, you do not know
whether the view will be a protection view or a shorthand view.
However, you can specify the view type by creating the view in pass-through mode:
select "tdm: sql create view $vol3.prsntabs.empview
as select * from $vol3.prsntabs.employee
where empnum > 1000
for protection
catalog $vol3.persnl"
After creating a view in pass-through mode, you can update the mapping tables using
the REFRESH statement:
select "tdm: util usercat refresh $vol3.persnl"
Creating a View WITH CHECK OPTION
When you create a view using the SQL statement CREATE VIEW, you cannot specify
WITH CHECK OPTION, which specifies that a row cannot be inserted through the view
unless the row satisfies the view definition. You can specify the check option, however,
by creating the view in pass-through mode:
select "tdm: sql create view $vol3.prsntabs.empview
as select * from $vol3.prsntabs.employee
where empnum > 1000
for protection
catalog $vol3.persnl
secure 'n-nu'
with check option"