Within RC/Migrator for DB2 for z/OS (RCM) 6 - Utility Model Services, how to code a customized model
to generate specific GRANT statements dependent on table name?
If a table name is a specific name requirement to GRANT SELECT access only otherwise GRANT full access.
Leverage the #IF and #ELSEIF logic within the RCM model syntax.
(Note - the table names are are not enclosed within quotes.)
#IF(%OBJECT,EQ,table1)
SET CURRENT SQLID = '%CREATOR';
GRANT SELECT ON TABLE
%CREATOR..%OBJECT
TO xxxxxxxx;
#ELSEIF(%OBJECT,EQ,table2)
SET CURRENT SQLID = '%CREATOR';
GRANT SELECT ON TABLE
%CREATOR..%OBJECT
TO xxxxxxxx;
#ELSEIF(%OBJECT,EQ,table3)
SET CURRENT SQLID = '%CREATOR';
GRANT SELECT ON TABLE
%CREATOR..%OBJECT
TO xxxxxxxx;
#ELSEIF(%OBJECT,EQ,table4)
SET CURRENT SQLID = '%CREATOR';
GRANT SELECT ON TABLE
%CREATOR..%OBJECT
TO xxxxxxxx;
#ELSE
SET CURRENT SQLID = '%CREATOR';
GRANT SELECT,UPDATE,INSERT,DELETE ON TABLE
%CREATOR..%OBJECT
TO xxxxxxxx;
#ENDIF