*   *ID* RENVIEW1 DBCMD    changed on 1992-11-11-17.02.10 by KERN      *
FILE CLEARK !
file CONNECT ( KERN TEST !
CREATE TABLE T1 (S1 INT) !
CREATE TABLE T2 (A1 INT) !
CREATE VIEW "v1" AS SELECT * FROM T1 !
INSERT T1 VALUES (1) !
INSERT T2 VALUES (1) !
CREATE VIEW V11 AS SELECT X.S1 FROM "v1" X WHERE X.S1 = 1 !
CREATE VIEW V12 AS SELECT "v1".S1 FROM "v1" WHERE "v1".S1 IN
                  (SELECT X.S1 FROM "v1" X WHERE X.S1 = 1 ) !
CREATE VIEW V13 AS SELECT X.S1 FROM "v1" X WHERE X.S1 IN
   (SELECT "v1".S1 FROM "v1" WHERE "v1".S1 = X.S1) !
CREATE VIEW V14 AS SELECT "v1".S1, T2.A1 FROM "v1", T2
   WHERE "v1".S1 = T2.A1 !
RENAME VIEW V14 TO V15 !
RENAME VIEW V15 TO V14 !
COMMIT !
CREATE VIEW "v15" AS SELECT "v1".S1 FROM "v1" WHERE S1 = 1
               UNION SELECT T2.A1   FROM T2   WHERE A1 = 1
               UNION SELECT "v1".S1 FROM "v1" WHERE S1 = 1 !
file sel_view ( V11 !
file sel_view ( V12 !
file sel_view ( V13 !
file sel_view ( V14 !
file sel_view ( v15 !
RENAME VIEW "v1" TO VIEW1 !
file sel_view ( V11 !
file sel_view ( V12 !
file sel_view ( V13 !
file sel_view ( V14 !
file sel_view ( v15 !
COMMIT !
SELECT * FROM V11 !
FETCH !
SELECT * FROM V12 !
FETCH !
SELECT * FROM V13 !
FETCH !
SELECT * FROM V14 !
FETCH !
SELECT * FROM "v15" !
FETCH !
SAVE CATALOG OF T1 INTO SAVE_TABLE1 !
CREATE TABLE T3 LIKE T1 !
COMMIT !
DROP TABLE T1 !
RENAME TABLE T3 TO T1 !
INSERT T1 VALUES (1) !
INSERT T2 VALUES (1) !
COMMIT !
RESTORE CATALOG FROM SAVE_TABLE1 !
SELECT * FROM SAVE_TABLE1 !
FETCH !
DROP TABLE SAVE_TABLE1 !
COMMIT !
RENAME VIEW VIEW1 TO "view,,,111" !
RENAME VIEW "view,,,111" TO "V,,11---" !
SELECT * FROM V11 !
FETCH !
SELECT * FROM V12 !
FETCH !
SELECT * FROM V13 !
FETCH !
SELECT * FROM T1 !
FETCH !
SELECT * FROM T2 !
FETCH !
SELECT * FROM V14 !
FETCH !
SELECT * FROM "v15" !
FETCH !
SAVE CATALOG OF T1 INTO SAVE_TABLE1 !
COMMIT !
CREATE TABLE T3 LIKE T1 !
DROP TABLE T1 !
RENAME TABLE T3 TO T1 !
COMMIT !
RESTORE CATALOG FROM SAVE_TABLE1 !
SELECT * FROM SAVE_TABLE1 !
FETCH !
RENAME VIEW "V,,11---" to v1 !
RENAME VIEW V1 TO VIEW1VIEW1VIEW1 !
RENAME VIEW VIEW1VIEW1VIEW1 TO "++++++++++++++" !
COMMIT !
DROP TABLE SAVE_TABLE1 !
SAVE CATALOG OF T1 INTO SAVE_TABLE1 !
COMMIT !
CREATE TABLE T3 LIKE T1 !
DROP TABLE T1 !
RENAME TABLE T3 TO T1 !
COMMIT !
RESTORE CATALOG FROM SAVE_TABLE1 !
COMMIT RELEASE !
* PTS 1000469/475 !
file cleark !
FILE connect ( domain domain!
INSTALLATION ON !
CREATE OR REPLACE VIEW DOMAIN.TABLES
          (OWNER,TABLENAME,PRIVILEGES,TYPE,CREATEDATE,CREATETIME,
           UPDSTATDATE,UPDSTATTIME,ALTERDATE,ALTERTIME,UNLOADED,
           SAMPLE_PERCENT,SAMPLE_ROWS,COMMENT)
        AS SELECT
             OWNER,TABLENAME,PRIVILEGES,TYPE,"DATE","TIME",
             UPDSTATDATE,UPDSTATTIME,ALTERDATE,ALTERTIME,UNLOADED,
             SAMPLE_PERCENT,SAMPLE_ROWS,COMMENT
           FROM SYSDD.TABLES
           WHERE type IN('TABLE','RESULT','SYNONYM',
           'VIEW','SYSTEM')
        INTERNAL !
        installation off !
GRANT SELECT ON DOMAIN.TABLES TO PUBLIC WITH GRANT OPTION !
        commit release !
file connect ( kern test !
CREATE VIEW VTRANS AS SELECT * FROM TRANSACTIONS!
CREATE VIEW VTRANS1 AS SELECT * FROM TRANSACTIONS!
SELECT * FROM VTRANS1!
CREATE VIEW VTABLES AS SELECT * FROM TABLES!
CREATE VIEW VTABLES1 AS SELECT * FROM TABLES!
SELECT * FROM VTABLES1!
COMMIT WORK RELEASE!
FILE connect ( kern test!
SAVE CATALOG USER INTO TEMP.SYS26_CATALOG!
SAVE CATALOG USER INTO SYS26_CATALOG!
COMMIT WORK RELEASE!
FILE connect ( kern test!
RENAME VIEW VTRANS TO XVTRANS!
SELECT * FROM XVTRANS!
COMMIT WORK RELEASE!
FILE connect ( kern test!
SELECT * FROM VTABLES!
DROP VIEW XVTABLES!
RENAME VIEW VTABLES TO XVTABLES!
SELECT * FROM XVTABLES!
COMMIT WORK RELEASE!
FILE connect ( sut sut!
SAVE CATALOG USER INTO SYS27_CATALOG!
COMMIT WORK RELEASE!
