Neoview SQL Reference Manual (R2.3)
• SHOWDDL always generates a Java signature for the SPJ.
• Privileges acquired by the object or procedure from the schema are displayed and preceded
by the comments “— Schema level privileges”. The corresponding GRANT statements
are also commented out. Schema level privileges only need to be applied at the schema level.
PRIVILEGES Option
The PRIVILEGES option includes the GRANT statements as they apply to the option. Each
privilege is specified in a separate GRANT even if they were granted in a single statement. For
example:
GRANT ALL PRIVILEGES ON TABLE t1 TO “role_user1”, “role_user2”:
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 INT NO DEFAULT -- NOT NULL
, C2 INT NO DEFAULT -- NOT NULL
, C3 CHAR(30) CHARACTER SET ISO88591 NOT CASESPECIFIC DEFAULT
NULL
, C4 DATE DEFAULT CURRENT_DATE
, C5 LARGEINT GENERATED BY DEFAULT AS IDENTITY
-- 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 a procedure with PRIVILEGES option:
176 SQL Statements