ODBC Server Reference Manual

Using Pass-Through Mode
HP NonStop ODBC Server Reference Manual429151-002
6-17
Creating or Altering Tables
Creating Columns With Default Values
When you create a table with the CREATE TABLE statement, you cannot specify
default values for columns. You can specify default values, however, by creating the
table in pass-through mode:
select "tdm: sql create table $vol3.saletabs.customer
(custnum numeric (4) unsigned no default,
custname character (25) no default,
city character (14) default 'San Jose')
catalog $vol3.sales”
After creating a table in pass-through mode, you can update the mapping tables using
the REFRESH statement:
select "tdm: util usercat refresh $vol3.sales"
You can also create a column with default values using the NonStop SQL/MP
statement ALTER TABLE in pass-through mode:
select "tdm: sql alter table $vol3.saletabs.customer
add column last_order_date
numeric (6) default 860000
catalog $vol3.sales”
You do not need to update the mapping tables after adding columns.
Creating a Constraint
The NonStop SQL/MP statement CREATE CONSTRAINT is not available in CORE
SQL or Transact-SQL. You can create a constraint, however, by using pass-through
mode:
select "tdm: sql create constraint
on $users.persnl.employee
check empnum between 0001 and 9999"
You do not need to update the mapping tables after adding or dropping a constraint.
Note. The equivalent in SQL Server is the statement CREATE RULE combined with the stored
procedure SP_BINDRULE; however, neither of these is supported by the NonStop ODBC
Server.