* SET_DB_H.TXT HARASAWA (HiRDB)
*(PERMISSION_BEGIN)*
=IF{_DB!='H'}JUMP{H_SKIP};
*********( CREATE USER )*************************************
=SET{WC.CONNECT='DBA'};
REPEAT0=$W0.PERMISSION
=MESSAGE{CREATE USER};
REPEAT=2 (WC.REAL_TEST##)
=SET{WC.PAS=WC.PASSWORD_?WC.REAL_TEST##?};
=SET{W0.REPEAT2CNT=0};
REPEAT2=4 (WC.DIOL--)
=COMPUTE{W0.REPEAT2CNT+=1};
=SET{WC.DIOL=WC.DIOL?W0.REPEAT2CNT?};
=IF{W0.REPEAT2CNT=4}SET{WC.PAS=WC.PASSWORD_LINK};
=LOGIN_SQL{GRANT ?WC.CONNECT? TO 
= ?WC.IS??WC.R_T##??WC.DIOL??WC.PER$$?
= IDENTIFIED BY "?WC.PAS?"};
=SET{WC.CONNECT='CONNECT'};
REPEAT0=
*********( CREATE SCEMA )************************************
=MESSAGE{CREATE SCHEMA};
REPEAT0=$W0.PERMISSION
REPEAT=2  (WC.REAL_TEST##=REAL;TEST)
=SET{W0.REPEAT2CNT=0};
REPEAT2=3 (WC.DIOL--=D;I;O) 
=COMPUTE{W0.REPEAT2CNT+=1};
=SET{WC.DIOL=WC.DIOL?W0.REPEAT2CNT?};
=SET{WC.SCHEMA='?WC.IS??WC.R_T##??WC.DIOL??WC.PER$$?'};
=IF_ERROR_LOGIN_SQL{CREATE SCHEMA AUTHORIZATION ?WC.SCHEMA?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
REPEAT0=
*(PERMISSION_END)*
********( CREATE DUAL_TABLE )********************************
REPEAT=2 (WC.REAL_TEST##)
=SET{WC.M=_M_?WC.REAL_TEST##?,_REAL_TEST=WC.REAL_TEST##};
=DBO_DROP_TABLE{?WC.M?ZZ_DUAL_TABLE};
=IF_ERROR_DBO_CREATE_TABLE{?WC.M?ZZ_DUAL_TABLE,ONE,INT}{}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=DBO_GRANT{?WC.M?ZZ_DUAL_TABLE,TABLE,PUBLIC};
=DBO_SQL{
= INSERT INTO ?WC.M?ZZ_DUAL_TABLE(ONE)VALUES(1)};
REPEAT=
****************************************
*(PERMISSION_BEGIN)*
=JUMP{H_SKIP};
*****( OBJECT_VIEW )********************************
NAME=H_OBJECT_VIEW
=SET{WC.I=WC.INSERT+'''H'','};
COPY=ADD10
=SQL{?WC?'(SYSTEM_KIND,SYSTEM_REAL,SYSTEM_WORK')};
COPY=ADD10
=SQL{?WC?',SYSTEM_USER_X,SYSTEM_NAME,SYSTEM_TEXT')};
COPY=ADD10
=SQL{?WC?',SYSTEM_ADD_DATE17,SYSTEM_CHANGE_DATE17')};
COPY=ADD10
=SQL{?WC?',SYSTEM_TYPES)AS SELECT')};
COPY=ADD10
=SQL{?WC?' CAST(''TABLE''  AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTR(TABLE_SCHEMA')};
COPY=ADD10
=SQL{?WC?',LENGTH(TABLE_SCHEMA)-4,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(TABLE_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS MVARCHAR(4000))')};
COPY=ADD10
=SQL{?WC?',CAST(CREATE_TIME AS CHAR(17))')};
COPY=ADD10
=SQL{?WC?',CAST(CHANGE_TIME AS CHAR(17))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS VARCHAR(4000))')};
COPY=ADD10
=SQL{?WC?' FROM MASTER.SQL_TABLES WHERE ')};
COPY=ADD10
=SQL{?WC?' TABLE_SCHEMA IN')};
COPY=ADD10
=SQL{?WC?'(?WC.H_OWNER?)')};
COPY=ADD10
=SQL{?WC?' AND TABLE_TYPE=''BASE TABLE''')};
COPY=ADD10
=SQL{?WC?' UNION SELECT CAST(''VIEW''  AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTR(VIEW_SCHEMA')};
COPY=ADD10
=SQL{?WC?',LENGTH(VIEW_SCHEMA)-4,1)AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(VIEW_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(VIEW_DEFINITION AS MVARCHAR(4000))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(17))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(17))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS VARCHAR(4000))')};
COPY=ADD10
=SQL{?WC?' FROM MASTER.SQL_VIEWS')};
COPY=ADD10
=SQL{?WC?' WHERE VIEW_SCHEMA IN')};
COPY=ADD10
=SQL{?WC?'(?WC.H_OWNER?) ')};
COPY=ADD10
=SQL{?WC?' UNION SELECT')};
COPY=ADD10
=SQL{?WC?' CAST(CASE R.ROUTINE_TYPE')};
COPY=ADD10
=SQL{?WC?' WHEN ''F'' THEN ''FUNC'' ')};
COPY=ADD10
=SQL{?WC?' ELSE ''PROC'' END AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTR(R.ROUTINE_SCHEMA')};
COPY=ADD10
=SQL{?WC?',LENGTH(R.ROUTINE_SCHEMA)-4,1)AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(R.ROUTINE_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS MVARCHAR(4000))')};
COPY=ADD10
=SQL{?WC?',CAST(R.CREATE_TIME AS CHAR(17))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(17)),CAST(''(''||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P1.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE  RTRIM(P1.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE  WHEN P2.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P2.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P3.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P3.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P4.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P4.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P5.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P5.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P6.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P6.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P7.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P7.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P8.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P8.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P9.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P9.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?' CASE WHEN  P10.DATA_TYPE IS NULL THEN ''''')};
COPY=ADD10
=SQL{?WC?' ELSE '',''||RTRIM(P10.DATA_TYPE) END||')};
COPY=ADD10
=SQL{?WC?''')'' AS VARCHAR(4000))')};
COPY=ADD10
=SQL{?WC?' FROM MASTER.SQL_ROUTINES R LEFT OUTER JOIN')};
COPY=ADD10
=SQL{?WC?' MASTER.SQL_ROUTINE_PARAMS P1')};
COPY=ADD10
=SQL{?WC?' ON R.ROUTINE_NAME=P1.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND P1.PARAMETER_NO=1 ')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P1.ROUTINE_SCHEMA')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P2')};
COPY=ADD10
=SQL{?WC?' ON  R.ROUTINE_NAME=P2.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND P2.PARAMETER_NO=2')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P2.ROUTINE_SCHEMA ')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P3')};
COPY=ADD10
=SQL{?WC?' ON  R.ROUTINE_NAME=P3.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND P3.PARAMETER_NO=3')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P3.ROUTINE_SCHEMA ')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P4')};
COPY=ADD10
=SQL{?WC?' ON  R.ROUTINE_NAME=P4.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND P4.PARAMETER_NO=4')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P4.ROUTINE_SCHEMA ')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P5')};
COPY=ADD10
=SQL{?WC?' ON R.ROUTINE_NAME=P5.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND P5.PARAMETER_NO=5')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P5.ROUTINE_SCHEMA ')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P6')};
COPY=ADD10
=SQL{?WC?' ON R.ROUTINE_NAME=P6.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND P6.PARAMETER_NO=6')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P6.ROUTINE_SCHEMA ')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P7')};
COPY=ADD10
=SQL{?WC?' ON R.ROUTINE_NAME=P7.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND P7.PARAMETER_NO=7')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P7.ROUTINE_SCHEMA ')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P8')};
COPY=ADD10
=SQL{?WC?' ON  R.ROUTINE_NAME=P8.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND  P8.PARAMETER_NO=8')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P8.ROUTINE_SCHEMA ')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P9')};
COPY=ADD10
=SQL{?WC?' ON R.ROUTINE_NAME=P9.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND  P9.PARAMETER_NO=9')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P9.ROUTINE_SCHEMA')};
COPY=ADD10
=SQL{?WC?' LEFT OUTER JOIN MASTER.SQL_ROUTINE_PARAMS P10')};
COPY=ADD10
=SQL{?WC?' ON R.ROUTINE_NAME=P10.ROUTINE_NAME')};
COPY=ADD10
=SQL{?WC?' AND P10.PARAMETER_NO=10 ')};
COPY=ADD10
=SQL{?WC?' AND R.ROUTINE_SCHEMA=P10.ROUTINE_SCHEMA')};
COPY=ADD10
=SQL{?WC?' WHERE R.ROUTINE_SCHEMA IN')};
COPY=ADD10
=SQL{?WC?'(?WC.H_OWNER?) ')};
COPY=ADD10
=SQL{?WC?' UNION SELECT CAST(''TRIG'' AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTR(T.TRIGGER_SCHEMA')};
COPY=ADD10
=SQL{?WC?',LENGTH(T.TRIGGER_SCHEMA)-4,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(T.TRIGGER_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTR(D.DEF_SOURCE,1,4000)')};
COPY=ADD10
=SQL{?WC?' AS MVARCHAR(4000))')};
COPY=ADD10
=SQL{?WC?',CAST(T.CREATE_TIME AS CHAR(17))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(17))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS VARCHAR(4000))')};
COPY=ADD10
=SQL{?WC?' FROM MASTER.SQL_TRIGGERS T')};
COPY=ADD10
=SQL{?WC?' INNER JOIN MASTER.SQL_TRIGGER_DEF_SOURCE D')};
COPY=ADD10
=SQL{?WC?' ON T.TRIGGER_SCHEMA=D.TRIGGER_SCHEMA')};
COPY=ADD10
=SQL{?WC?' AND T.TRIGGER_NAME=D.TRIGGER_NAME')};
COPY=ADD10
=SQL{?WC?' WHERE T.TRIGGER_SCHEMA IN')};
COPY=ADD10
=SQL{?WC?'(?WC.H_OWNER?) ')};
*****( COLUMN_VIEW )**************************************
NAME=H_COLUMN_VIEW
=SET{WC.I=WC.INSERT+'''H'','};
COPY=ADD10
=SQL{?WC?'(SYSTEM_KIND,SYSTEM_REAL,SYSTEM_WORK')};
COPY=ADD10
=SQL{?WC?',SYSTEM_USER_X,SYSTEM_NAME,SYSTEM_SEQ')};
COPY=ADD10
=SQL{?WC?',SYSTEM_DATA_NAME,SYSTEM_DEFAULT_TYPE')};
COPY=ADD10
=SQL{?WC?',SYSTEM_DEFAULT_LENGTH1')};
COPY=ADD10
=SQL{?WC?',SYSTEM_DEFAULT_LENGTH2')};
COPY=ADD10
=SQL{?WC?',SYSTEM_DEFAULT,SYSTEM_NULL)AS SELECT')};
COPY=ADD10
=SQL{?WC?' CAST(CASE WHEN C.TABLE_NAME IS NULL')};
COPY=ADD10
=SQL{?WC?' THEN ''VIEW''')};
COPY=ADD10
=SQL{?WC?' ELSE ''TABLE'' END AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTR(C.TABLE_SCHEMA')};
COPY=ADD10
=SQL{?WC?',LENGTH(C.TABLE_SCHEMA)-4,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(C.TABLE_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',C.COLUMN_ID')};
COPY=ADD10
=SQL{?WC?',CAST(C.COLUMN_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE C.DATA_TYPE')};
COPY=ADD10
=SQL{?WC?' WHEN ''MCHAR'' THEN ''NCHAR''')};
COPY=ADD10
=SQL{?WC?' WHEN ''MVARCHAR'' THEN ''NVARCHAR''')};
COPY=ADD10
=SQL{?WC?' WHEN ''TIMESTAMP'' THEN ''DATETIME'' ')};
COPY=ADD10
=SQL{?WC?' WHEN ''INTEGER'' THEN ''INT''')};
COPY=ADD10
=SQL{?WC?' WHEN ''SMALLINT'' THEN ''INT''')};
COPY=ADD10
=SQL{?WC?' ELSE C.DATA_TYPE END AS CHAR(9))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE C.DATA_TYPE')};
COPY=ADD10
=SQL{?WC?' WHEN ''DECIMAL'' THEN ')};
COPY=ADD10
=SQL{?WC?' SUBSTR(C.DATA_LENGTH,2,2)')};
COPY=ADD10
=SQL{?WC?' WHEN ''FLOAT'' THEN ''9'' ')};
COPY=ADD10
=SQL{?WC?' WHEN ''INTEGER'' THEN ''9''')};
COPY=ADD10
=SQL{?WC?' WHEN ''SMALLINT'' THEN ''9''')};
COPY=ADD10
=SQL{?WC?' WHEN ''TIMESTAMP'' THEN ''17''')};
COPY=ADD10
=SQL{?WC?' WHEN ''DATE'' THEN ''8''')};
COPY=ADD10
=SQL{?WC?' ELSE C.DATA_LENGTH END AS INT)')};
COPY=ADD10
=SQL{?WC?',CAST(CASE C.DATA_TYPE')};
COPY=ADD10
=SQL{?WC?' WHEN ''DECIMAL'' THEN ')};
COPY=ADD10
=SQL{?WC?' SUBSTR(C.DATA_LENGTH,5,2)')};
COPY=ADD10
=SQL{?WC?' ELSE ''0'' END AS INT)')};
COPY=ADD10
=SQL{?WC?',CAST(C.DEFAULT_VALUE AS CHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE C.IS_NULLABLE')};
COPY=ADD10
=SQL{?WC?' WHEN ''NO'' THEN ''0''')};
COPY=ADD10
=SQL{?WC?' ELSE ''1'' END AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?' FROM MASTER.SQL_COLUMNS C ')};
COPY=ADD10
=SQL{?WC?' LEFT JOIN MASTER.SQL_TABLES T ')};
COPY=ADD10
=SQL{?WC?' ON C.TABLE_SCHEMA=T.TABLE_SCHEMA')};
COPY=ADD10
=SQL{?WC?' AND C.TABLE_NAME=T.TABLE_NAME ')};
COPY=ADD10
=SQL{?WC?' WHERE C.TABLE_SCHEMA IN')};
COPY=ADD10
=SQL{?WC?'(?WC.H_OWNER?)')};
*****( INDEX_VIEW )******************************************
NAME=H_INDEX_VIEW
=SET{WC.I=WC.INSERT+'''H'','};
COPY=ADD10
=SQL{?WC?'(SYSTEM_REAL,SYSTEM_WORK,SYSTEM_USER_X')};
COPY=ADD10
=SQL{?WC?',SYSTEM_NAME,SYSTEM_DATA_NAME')};
COPY=ADD10
=SQL{?WC?',SYSTEM_IX,SYSTEM_NO)AS SELECT')};
COPY=ADD10
=SQL{?WC?' CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTR(C.TABLE_SCHEMA')};
COPY=ADD10
=SQL{?WC?',LENGTH(C.TABLE_SCHEMA)-4,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(C.TABLE_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(C.COLUMN_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE SUBSTR(I.INDEX_NAME')};
COPY=ADD10
=SQL{?WC?',LENGTH(I.INDEX_NAME),1) ')};
COPY=ADD10
=SQL{?WC?' WHEN '')'' THEN ''0'' ELSE ')};
COPY=ADD10
=SQL{?WC?' SUBSTR(I.INDEX_NAME')};
COPY=ADD10
=SQL{?WC?',LENGTH(I.INDEX_NAME),1) END AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(C.INDEX_ORDER-CASE I.UNIQUE_TYPE')};
COPY=ADD10
=SQL{?WC?' WHEN ''U'' THEN 1')};
COPY=ADD10
=SQL{?WC?' ELSE 0 END AS INT)')};
COPY=ADD10
=SQL{?WC?' FROM MASTER.SQL_INDEX_COLINF C ')};
COPY=ADD10
=SQL{?WC?' INNER JOIN MASTER.SQL_INDEXES I')};
COPY=ADD10
=SQL{?WC?' ON C.TABLE_SCHEMA=I.TABLE_SCHEMA')};
COPY=ADD10
=SQL{?WC?' AND C.TABLE_NAME=I.TABLE_NAME')};
COPY=ADD10
=SQL{?WC?' AND C.INDEX_NAME=I.INDEX_NAME')};
COPY=ADD10
=SQL{?WC?' WHERE C.TABLE_SCHEMA IN')};
COPY=ADD10
=SQL{?WC?'(?WC.H_OWNER?)')};
*****( GRANT_VIEW )******************************************
NAME=H_GRANT_VIEW
=SET{WC.I=WC.INSERT+'''H'','};
COPY=ADD10
=SQL{?WC?'(SYSTEM_KIND,SYSTEM_REAL,SYSTEM_WORK')};
COPY=ADD10
=SQL{?WC?',SYSTEM_USER_X,SYSTEM_NAME,SYSTEM_GRANT')};
COPY=ADD10
=SQL{?WC?',SYSTEM_SELECT,SYSTEM_INSERT')};
COPY=ADD10
=SQL{?WC?',SYSTEM_UPDATE,SYSTEM_DELETE')};
COPY=ADD10
=SQL{?WC?',SYSTEM_EXECUTE)AS SELECT')};
COPY=ADD10
=SQL{?WC?' CAST(''TABLE'' AS CHAR(5))')};
COPY=ADD10
=SQL{?WC?',CAST(''?_Q?_REAL_TEST?_Q?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(''?WC.MAST_WORK?'' AS CHAR(4))')};
COPY=ADD10
=SQL{?WC?',CAST(SUBSTR(TABLE_SCHEMA')};
COPY=ADD10
=SQL{?WC?',LENGTH(TABLE_SCHEMA)-4,1) AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(TABLE_NAME AS MCHAR(30))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE GRANTEE')};
COPY=ADD10
=SQL{?WC?' WHEN ''PUBLIC'' THEN GRANTEE ELSE')};
COPY=ADD10
=SQL{?WC?' SUBSTR(GRANTEE,4,1)||''_''')};
COPY=ADD10
=SQL{?WC?'||SUBSTR(GRANTEE,5,4)  END AS CHAR(6))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE SELECT_PRIVILEGE')};
COPY=ADD10
=SQL{?WC?' WHEN ''Y'' THEN ''S''')};
COPY=ADD10
=SQL{?WC?' ELSE '' '' END AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE INSERT_PRIVILEGE')};
COPY=ADD10
=SQL{?WC?' WHEN ''Y'' THEN ''I''')};
COPY=ADD10
=SQL{?WC?' ELSE '' '' END AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE UPDATE_PRIVILEGE')};
COPY=ADD10
=SQL{?WC?' WHEN ''Y'' THEN ''U''')};
COPY=ADD10
=SQL{?WC?' ELSE '' '' END AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST(CASE DELETE_PRIVILEGE')};
COPY=ADD10
=SQL{?WC?' WHEN ''Y'' THEN ''D''')};
COPY=ADD10
=SQL{?WC?' ELSE '' '' END AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?',CAST('' '' AS CHAR(1))')};
COPY=ADD10
=SQL{?WC?' FROM MASTER.SQL_TABLE_PRIVILEGES ')};
COPY=ADD10
=SQL{?WC?' WHERE TABLE_SCHEMA IN')};
COPY=ADD10
=SQL{?WC?'(?WC.H_OWNER?)')};
COPY=ADD10
=SQL{?WC?' AND (SUBSTR(TABLE_SCHEMA,1,3)')};
COPY=ADD10
=SQL{?WC?'=SUBSTR(GRANTEE,1,3)')};
COPY=ADD10
=SQL{?WC?' OR GRANTEE=''PUBLIC'') ')};
NAME=
***********************
=SET{_REAL_TEST='REAL'};
=H_SKIP:
*(PERMISSION_END)*
