* SET_DB_F.TXT HARASAWA (Symforware)
F-COMMENT_BEGIN
*********( CREATE DATABASE )*********************************
*(PERMISSION_BEGIN)*
=IF{_DB!='F'}JUMP{F_SKIP};
NAME=OP
=WRITE_OPEN{1,F.TXT,OT,/};
NAME=
*(PERMISSION_END)*
=WRITE{1,'CREATE DATABASE I_?_SYSTEM?;'};
*(PERMISSION_BEGIN)*
=SET{WC.CM=
= 'SET RDBNAME=?$INSTANCE?&rdbddlex -d I_?_SYSTEM?'};
NAME=CL_CMD
=WRITE_CLOSE{{1};
=COMMAND{?WC.CM? \I\TMP\F.TXT}; 
NAME=
REPEAT0=$W0.PERMISSION
=SET{WC.DRV=DRIVE1};
REPEAT=2  (WC.REAL_TEST##=REAL;TEST)
=SET{W0.REPEAT2CNT=0};
REPEAT2=2 (WC.M_W) 
=COMPUTE{W0.REPEAT2CNT+=1};
=SET{WC.M_W=WC.M_W?W0.REPEAT2CNT?};
=SET{WC.DBS='I?_SYSTEM??WC.R_T##??WC.M_W??WC.PER$$?'};
COPY=OP
=SET{WC.DBSPACE='CREATE DBSPACE ?WC.DBS? ALLOCATE FILE'
=+' ?WC.DRV?:?_P?I?_P?DATABASE?_P??_SYSTEM?.I?_P?'
=+'I?_SYSTEM??WC.R_T##??WC.M_W??WC.PER$$?.DBS'
=+' ATTRIBUTE SPACE (250M);'}; 
=WRITE{1,WC.DBSPACE};
COPY=CL_CMD
REPEAT2=
=SET{WC.DRV=DRIVE3};
REPEAT0=
*********( CREATE USER )*************************************
=MESSAGE{CREATE USER};
=LOGIN_SQL{SET SYSTEM PARAMETER USER_CONTROL=YES};
REPEAT0=$W0.PERMISSION
REPEAT=2 (WC.REAL_TEST##) 
=SET{WC.PAS=WC.PASSWORD_?WC.REAL_TEST##?};
=SET{WC.CU='CREATEDB CREATEUSER'};
=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};
=IF_ERROR_LOGIN_SQL{
=  CREATE USER ?WC.IS??WC.R_T##??WC.DIOL??WC.PER$$?
=                 WITH DBMS PASSWORD '?WC.PAS?' FOR USER}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
REPEAT0=
*********( CREATE SCEMA )************************************
=MESSAGE{CREATE SCHEMA};
REPEAT0=$W0.PERMISSION
REPEAT=2  (WC.REAL_TEST##=REAL;TEST)
=SET{W0.REPEAT2CNT=0};
REPEAT2=2 (WC.M_W=M,W) 
=COMPUTE{W0.REPEAT2CNT+=1};
=SET{WC.M_W=WC.M_W?W0.REPEAT2CNT?};
=IF_ERROR_LOGIN_SQL{
=   CREATE SCHEMA ?WC.IS??WC.R_T##??WC.M_W??WC.PER$$?}
=   IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
REPEAT0=
*************( GRANT ALL )***********************************
REPEAT0=$W0.PERMISSION
=MESSAGE{GRANT_SCHEMA(?WC.PER$$?)};
REPEAT=3
=SET{W0.REPEAT2CNT=0};
=SET{WC.PERX='ZZZZ'};
REPEAT2=2 (ZZZZ,自分)
=COMPUTE{W0.REPEAT2CNT+=1};
=SET{WC='GRANT ALL PRIVILEGES ON SCHEMA ?WC.IS??WC.RTT##?'};
=IF_ERROR_LOGIN_SQL{?WC?M?WC.PER$$? TO ?WC.IS?RDZZZZ}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF_ERROR_LOGIN_SQL{?WC?M?WC.PER$$?
=    TO ?WC.IS??WC.RRT##?D?WC.PERX?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF_ERROR_LOGIN_SQL{?WC?W?WC.PER$$?
=    TO ?WC.IS??WC.RRT##?D?WC.PERX?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF_ERROR_LOGIN_SQL{?WC?W?WC.PER$$?
=    TO ?WC.IS??WC.RRT##?I?WC.PERX?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF_ERROR_LOGIN_SQL{?WC?W?WC.PER$$?
=    TO ?WC.IS??WC.RRT##?O?WC.PERX?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=SET{WC='GRANT ALL PRIVILEGES ON DBSPACE ?WC.IS??WC.RTT##?'};
=IF_ERROR_LOGIN_SQL{?WC?M?WC.PER$$? TO ?WC.IS?RDZZZZ}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF_ERROR_LOGIN_SQL{?WC?M?WC.PER$$?
= TO ?WC.IS??WC.RRT##?D?WC.PERX?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF_ERROR_LOGIN_SQL{?WC?W?WC.PER$$?
= TO ?WC.IS??WC.RRT##?D?WC.PERX?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF_ERROR_LOGIN_SQL{?WC?W?WC.PER$$?
= TO ?WC.IS??WC.RRT##?I?WC.PERX?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF_ERROR_LOGIN_SQL{?WC?W?WC.PER$$?
= TO ?WC.IS??WC.RRT##?O?WC.PERX?}
=  IF{_DB_I_ERROR!='EXIST'}ERROR{?_DB_ERROR? ?_ERROR?};
=IF{WC.PER$$='ZZZZ'}JUMP{J};
=SET{WC.PERX=WC.PER$$};
REPEAT2=
=J:
REPEAT0=
=F_SKIP:
*(PERMISSION_END)*
F-COMMENT_END
