Question:
Why does the Owner not generate in my Forward Engineering Script even though the macro %TableOwner is stated in my Script Template?
Target Database: Oracle 11g/12c/18c
Prerequisites:
- Create Script Template with the Macro %Table Owner, with the following Parameters:
- Script Type: Model Level/Table Level -- create at Table level.
- Generate As: Post-Creation
- Generate: Checked
- In the Code tab insert code containing the Macro %TableOwner, for example: GRANT SELECT, INSERT, DELETE, UPDATE ON %TableOwner.%TableName ;
- Right Click on a Table to apply the Script:
- Right Click on Table > Select Table Properties
- Click on the Object Creation Order tab
- Click on the drop-down Display: Script Templates
- The Script Template created will appear, check the check-box to activate the Script Template
You can also create it at a Model level in which case it will be created a bit differently using the macro '%ForEachTable() {GRANT SELECT, INSERT, DELETE, UPDATE ON %TableOwner.%TableName ; } In that case you do not need to attach to any specific Table (steps for # 2 above) as it will be created for each Table at the end of the script generation in Forward Engineering.
Answer:
- Open the Forward Engineer Schema Generation Wizard
- Click the Option Selection: Table > check the Post-Script checkbox
- Click the Option Selection: Other Options > check the 'Owner' checkbox
- Click the Preview menu to view the Forward Engineering Script
Result: The following script with Owner will appear after the "Create <Table Name>" statements: GRANT SELECT, INSERT, DELETE, UPDATE ON <Table Owner>.<Table Name> ;
Comments
0 comments
Article is closed for comments.