Considerations For Alter Table; Effect Of Adding A Column On View Definitions; Authorization And Availability Requirements; Example Of Alter Table - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

column data-type
specifies the name and data type for a column in the table.
column is an SQL identifier. column must be unique among column names in the table. If
the name is a Neoview SQL reserved word, you must delimit it by enclosing it in double
quotes. Such delimited parts are case-sensitive. For example: "join".
data-type is the data type of the values that can be stored in column. A default value must
be of the same type as the column, including the character set for a character column. See
"Data Types" (page
DEFAULT default | NO DEFAULT
specifies a default value for the column or specifies that the column does not have a default
value. You can declare the default value explicitly by using the DEFAULT clause, or you can
enable null to be used as the default by omitting both the DEFAULT and NOT NULL clauses.
If you omit the DEFAULT clause and specify NOT NULL, Neoview SQL returns an error.
For existing rows of the table, the added column takes on its default value.
If you set the default to the datetime value CURRENT_DATE, CURRENT_TIME, or
CURRENT_TIMESTAMP, Neoview SQL uses January 1, 1 A.D. 12:00:00.000000 as the default
date and time for the existing rows.
For any row that you add after the column is added, if no value is specified for the column
as part of the add row operation, the column receives a default value based on the current
timestamp at the time the row is added.
CONSTRAINT constraint
specifies a name for the column or table constraint. constraint must have the same schema
as table and must be unique among constraint names in its schema. If you omit the schema
portions of the name you specify in constraint, Neoview SQL expands the constraint
name by using the schema for table. See
If you do not specify a constraint name, Neoview SQL constructs an SQL identifier as the
name for the constraint in the schema for table.The identifier consists of the fully qualified
table name concatenated with a system-generated unique identifier. For example, a constraint
on table A.B.C might be assigned a name such as A.B.C_123..._01... .

Considerations for ALTER TABLE

Effect of Adding a Column on View Definitions

The addition of a column to a table has no effect on existing view definitions. Implicit column
references specified by SELECT * in view definitions are replaced by explicit column references
when the definition clauses are originally evaluated.

Authorization and Availability Requirements

To alter a table, you must own its schema or be the super id. You must also have access to all
indexes of the table itself.
ALTER TABLE works only on user-created tables.

Example of ALTER TABLE

This example adds a column:
ALTER TABLE persnl.project
ADD COLUMN projlead
NUMERIC (4) UNSIGNED
197).
"Database Object Names" (page
196).
ALTER TABLE Statement
49

Advertisement

Table of Contents
loading

Table of Contents