Examples Of Create Set Table; Example Of Create Set Volatile Table; Examples Of Create Table As - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

The row is returned in this example. Both sides are case sensitive.
SELECT * FROM T WHERE a = 'A' (not casespecific);
A row is not returned in this example. A case sensitive comparison is done since column 'b'
is case sensitive.
SELECT * FROM T WHERE b = 'A';
A row is not returned in this example. A case sensitive comparison is done since column 'b'
is case sensitive.
SELECT * FROM T WHERE b = 'A' (not casespecific);

Examples of CREATE SET TABLE

This is an example of creating a SET table:
>>Create SET table T (a int not null, b int, primary key (a));
--- SQL operation complete.
>>insert into T values(1,2);
--- 1 row(s) inserted.
>>insert into T values(1,2);
--- 0 row(s) inserted.
>>insert into T values(1, 4);
*** ERROR[8102] The operation is prevented by a unique constraint.
--- 0 row(s) inserted.
>>select * from T;
A
-----------
1
--- 1 row(s) selected.

Example of CREATE SET VOLATILE TABLE

This example shows creating a volatile table as a SET table:
>>CREATE SET VOLATILE TABLE t (a int not null, b int, primary key (a));
--- SQL operation complete.
>>INSERT INTO t VALUES (1,2);
--- 1 row(s) inserted.
>>INSERT INTO t VALUES (1,2);
--- 0 row(s) inserted.

Examples of CREATE TABLE AS

This section shows the column attribute rules used to generate and specify the column names
and data types of the table being created.
If column-attributes are not specified, the select list items of the select-query are used
to generate the column names and data attributes of the created table. If the select list item
is a column, then it is used as the name of the created column. For example:
create table t no partition as select a,b from t1
94
SQL Statements
B
-----------
2

Advertisement

Table of Contents
loading

Table of Contents