Examples Of Showddl - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

will be displayed as:
GRANT SELECT ON TABLE sch.t1 TO "role_user1";
GRANT UPDATE ON TABLE sch.t1 TO "role_user1";
GRANT DELETE ON TABLE sch.t1 TO "role_user1";
GRANT INSERT ON TABLE sch.t1 TO "role_user1";
GRANT REFERENCES ON TABLE sch.t1 TO "role_user1";
GRANT SELECT ON TABLE sch.t1 TO "role_user2";
GRANT UPDATE ON TABLE sch.t1 TO "role_user21";
GRANT DELETE ON TABLE sch.t1 TO "role_user21";
GRANT INSERT ON TABLE sch.t1 TO "role_user2";
GRANT REFERENCES ON TABLE sch.t1 TO "role_user2";

Examples of SHOWDDL

SHOWDDL with no options:
-- Create a table
set schema neo.sch;
create table t1
( c1 int not null
, c2 int not null
, c3 char (30) NOT CASESPECIFIC
, c4 date default current_date
, c5 largeint generated by default as identity
, primary key (c2, c1))
partition by (c1)
max table size 2000;
-- showddl
SHOWDDL T1;
-- showddl output
CREATE TABLE SCH.T1
(
C1
, C2
, C3
CASESPECIFIC DEFAULT NULL
, C4
, C5
-- NOT NULL
, CONSTRAINT SCH.T1_985546634_1496 PRIMARY KEY (C2 ASC, C1 ASC)
, CONSTRAINT SCH.T1_491636634_1496 CHECK (SCH.T1.C1 IS NOT NULL AND
SCH.T1.C2 IS NOT NULL AND SCH.T1.C3 IS NOT NULL AND SCH.T1.C5
IS NOT NULL)
)
HASH PARTITION BY (C1)
MAX TABLE SIZE 2000
;
-- Create a view
Create view t1_view as select c2, c3 from t1 where c1 > 0;
-- showddl
SHOWDDL T1_VIEW;
-- showddl output
CREATE VIEW SCH.T1_VIEW1 AS
SELECT SCH.T1.C1, SCH.T1.C2 FROM SCH.T1 WHERE SCH.C1 > 0;
SHOWDDL on several objects with PRIVILEGES option:
-- add some schema level privileges
Grant select on schema sch to "role_reader";
-- create some tables and their dependent objects:
create table empl
(empl_no int not null primary key,
empl_name char(50) not null,
empl_address varchar(50) not null,
dept_no int not null,
194
SQL Statements
INT NO DEFAULT -- NOT NULL
INT NO DEFAULT -- NOT NULL
CHAR(30) CHARACTER SET ISO88591 NOT
DATE DEFAULT CURRENT_DATE
LARGEINT GENERATED BY DEFAULT AS IDENTITY

Advertisement

Table of Contents
loading

Table of Contents