AD_ZD_TABLE : Steps to follow while creating table in R12.2.*
***********
* GRANTS *
**********
Team – do not use Grant statements in the SQL scripts while migrating through STAT
, instead use EXEC AD_ZD.GRANT_PRIVS.
Manual steps run in DEV Environment:
1. As XXCUST, manually Create/Alter custom table in EBSDEV or EBSPROJ (XXCUST schema for all custom tables).
2. In EBSDEV/EBSPROJ:
If creating the table, run:
AD_ZD_TABLE.UPGRADE (‘SCHEMA’,’TABLE’);
If altering the table, run:
AD_ZD_TABLE.PATCH (‘SCHEMA’,’TABLE’);
3. Insert at least one row of data in the custom table.
* This is mandatory for XDF to extract the table definition and for successful Stat archive set creation.
4. As table owner, grant privileges on new/altered table and editioned view to APPS, primarily so AD_ZD.GRANT_PRIVS can be run for privileges.
GRANT ALL ON SCHEMA.TABLE TO APPS WITH GRANT OPTION;
GRANT ALL ON SCHEMA.EDITIONED_VIEW# TO APPS WITH GRANT OPTION;
5. If additional privileges are required on the new/altered table, the following needs to be run as APPS:
exec AD_ZD.GRANT_PRIVS (‘PRIVS’,’TABLE’,’TO USER’);
* For PRIVS, do not use ‘ALL’. Specify only what is needed (ALTER, UPDATE, etc.)
To migrate to other environments, create a SQL Script with AD_ZD.grant_privs and place in the Stat Working Directory.
=================================================================
Example below:
CREATE TABLE XXCUST.XXCUST_rma_rpd_upld_stg(batch_id NUMBER
,upload_file_name VARCHAR2(500)
,request_id NUMBER
,operating_unit VARCHAR2(10)
,customer_po VARCHAR2(50)
,so_number VARCHAR2(50)
,line_number VARCHAR2(20)
,item VARCHAR2(50)
,quantity VARCHAR2(20)
,rma_order_type VARCHAR2(50)
,return_reason VARCHAR2(250)
,restock_modifier_percent VARCHAR2(20)
,update_rma_po_number VARCHAR2(50)
,status VARCHAR2(10)
,error_message VARCHAR2(2000)
,attribute1 VARCHAR2(500)
,attribute2 VARCHAR2(500)
,attribute3 VARCHAR2(500)
,attribute4 VARCHAR2(500)
,attribute5 VARCHAR2(500)
,attribute6 VARCHAR2(500)
,attribute7 VARCHAR2(500)
,attribute8 VARCHAR2(500)
,attribute9 VARCHAR2(500)
,attribute10 VARCHAR2(500)
,attribute11 VARCHAR2(500)
,attribute12 VARCHAR2(500)
,attribute13 VARCHAR2(500)
,attribute14 VARCHAR2(500)
,attribute15 VARCHAR2(500)
,created_by NUMBER
,creation_date DATE
,last_updated_by NUMBER
,last_update_date DATE
,last_update_login NUMBER
);
--in XXCUST schema
GRANT ALL ON XXCUST.XXCUST_rma_rpd_upld_stg TO APPS WITH GRANT OPTION;
--in APPS schema
BEGIN
--If creating the table, run:
apps.AD_ZD_TABLE.UPGRADE('XXCUST','XXCUST_RMA_RPD_UPLD_STG');
--If altering the table, run:
--apps.AD_ZD_TABLE.PATCH('XXCUST','XXCUST_RMA_RPD_UPLD_STG');
END;
--in XXCUST schema
GRANT ALL ON XXCUST.XXCUST_rma_rpd_upld_stg# TO APPS WITH GRANT OPTION;
Comments
Post a Comment