home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Treasures, Inc.
/
pctreasures.mdf
/
WINDOWS
/
adabas
/
f_0001
/
env
/
query.ins
< prev
next >
Wrap
Text File
|
1999-11-01
|
4KB
|
163 lines
SAY --- Installing system tables for QUERY ...
/
/* @(#)QUERY.ins 10.01.00 1998-01-30
/ *****************************************************
/ Systemtables of the Conversational Component QUERY
/ *****************************************************
/
/
INIT SERVERDB
/
IF $RC (SHOW VIEW SYSQUERYLIBRARY) = 0
THEN
/
DROP VIEW SYSQUERYLIBRARY
/
IF $RC (EXISTS TABLE SYSQUERYLIBRARY) <> 0
THEN
BEGIN
/
CREATE TABLE SYSQUERYLIBRARY
(
AUTHOR CHAR(18) ASCII KEY DEFAULT USERGROUP,
COMMAND_NAME CHAR(18) ASCII KEY DEFAULT ' ',
BLANK_KEY4 CHAR(18) ASCII KEY DEFAULT ' ',
BLANK_KEY5 CHAR(18) ASCII KEY DEFAULT ' ',
OBJTYPE CHAR(18) ASCII KEY DEFAULT 'QUERYCOMMAND',
BLANK_KEY6 CHAR(12) ASCII KEY DEFAULT ' ',
BLANK_KEY7 CHAR(4) ASCII KEY DEFAULT ' ',
CREATEDATE DATE DEFAULT DATE,
CREATETIME TIME DEFAULT TIME,
UPDATEDATE DATE DEFAULT DATE,
UPDATETIME TIME DEFAULT TIME,
STRLENGTH FIXED(18),
CODETYPE CHAR(6) ASCII,
COMMAND LONG BYTE
)
/
GRANT SELECT, UPDATE, INSERT, DELETE ON SYSQUERYLIBRARY TO DOMAIN
/
GRANT SELECT ON SYSQUERYLIBRARY TO PUBLIC
/
IF $RC (SHOW VIEW SYSQUERYLIB) = 0
THEN
/
DROP VIEW SYSQUERYLIB
/
CREATE VIEW SYSQUERYLIB
AS SELECT *
FROM SYSQUERYLIBRARY
WHERE author = USERGROUP
WITH CHECK OPTION
/
GRANT SELECT, UPDATE, INSERT, DELETE ON SYSQUERYLIB TO PUBLIC
/
COMMIT WORK
/
END
/
IF $RC (SHOW VIEW SYSQU_USR_ACCS_QCM) = 0
THEN
/
DROP VIEW SYSQU_USR_ACCS_QCM
/
IF $RC (EXISTS TABLE SYSQU_USR_ACCS_QCM) <> 0
THEN
BEGIN
/
CREATE TABLE SYSQU_USR_ACCS_QCM
(
DEFOBJTYPE CHAR(18) ASCII KEY DEFAULT 'USER',
BLANK_KEY2 CHAR(18) ASCII KEY DEFAULT ' ',
BLANK_KEY3 CHAR(18) ASCII KEY DEFAULT ' ',
GRANTEE CHAR(18) ASCII KEY DEFAULT USERGROUP,
BLANK_KEY5 CHAR(18) ASCII KEY DEFAULT ' ',
BLANK_KEY6 CHAR(12) ASCII KEY DEFAULT ' ',
BLANK_KEY7 CHAR(4) ASCII KEY DEFAULT ' ',
REFOBJTYPE CHAR(18) ASCII KEY DEFAULT 'QUERYCOMMAND',
AUTHOR CHAR(18) ASCII KEY DEFAULT USERGROUP,
COMMAND_NAME CHAR(18) ASCII KEY DEFAULT ' ',
BLANK_KEY11 CHAR(18) ASCII KEY DEFAULT ' ',
BLANK_KEY12 CHAR(18) ASCII KEY DEFAULT ' ',
BLANK_KEY13 CHAR(12) ASCII KEY DEFAULT ' ',
BLANK_KEY14 CHAR(4) ASCII KEY DEFAULT ' ',
RELTYPE CHAR(18) ASCII KEY DEFAULT 'ACCESSES',
PRIV CHAR(4) ASCII
)
/
GRANT INSERT, DELETE, UPDATE, SELECT ON SYSQU_USR_ACCS_QCM TO DOMAIN
/
IF $RC (SHOW VIEW SYSQUERY_OWN) = 0
THEN
/
DROP VIEW SYSQUERY_OWN
/
CREATE VIEW SYSQUERY_OWN
AS SELECT *
FROM SYSQU_USR_ACCS_QCM
WHERE author = USERGROUP AND grantee = USERGROUP
WITH CHECK OPTION
/
GRANT INSERT, DELETE, UPDATE, SELECT ON SYSQUERY_OWN TO PUBLIC
/
IF $RC (SHOW VIEW SYSQUERY_GRANT) = 0
THEN
/
DROP VIEW SYSQUERY_GRANT
/
CREATE VIEW SYSQUERY_GRANT
AS SELECT *
FROM SYSQU_USR_ACCS_QCM
WHERE author = USERGROUP AND grantee <> USERGROUP
WITH CHECK OPTION
/
GRANT INSERT, DELETE, UPDATE, SELECT ON SYSQUERY_GRANT TO PUBLIC
/
IF $RC (SHOW VIEW SYSQUERY_CALL) = 0
THEN
/
DROP VIEW SYSQUERY_CALL
/
CREATE VIEW SYSQUERY_CALL
AS SELECT *
FROM SYSQU_USR_ACCS_QCM
WHERE author <> USERGROUP AND grantee IN(USERGROUP,'PUBLIC')
WITH CHECK OPTION
/
GRANT SELECT ON SYSQUERY_CALL TO PUBLIC
/
COMMIT WORK
/
END
/
IF $RC (EXISTS TABLE SYSQUHISTORY) <> 0
THEN
BEGIN
/
CREATE TABLE SYSQUHISTORY
(
OWNER CHAR(18) ASCII KEY DEFAULT 'USER',
CODETYPE CHAR(6) ASCII,
PREVREC LONG ASCII
)
/
IF $RC (SHOW VIEW SYSQUHIST) = 0
THEN
/
DROP VIEW SYSQUHIST
/
CREATE VIEW SYSQUHIST
AS SELECT *
FROM SYSQUHISTORY
WHERE owner = USER
WITH CHECK OPTION
/
GRANT INSERT, UPDATE, SELECT ON SYSQUHIST TO PUBLIC
/
COMMIT WORK
/
END
/
END INIT SERVERDB
/