An action corresponds to a DDL operation (create table, drop reference, etc). Each action contains several Action Lines, corresponding to the commands required to perform the DDL operation (for example, dropping a table requires dropping all its constraints first).
Action lines contain statements valid for the technology of the action group. Unlike procedures or knowledge module commands, these statements use a single connection (SELECT ... INSERT statements are not possible). In the style of the knowledge modules, action make use of the substitution methods to make their DDL code generic.
For example, an action line may contain the following code to drop a check constraint on a table:
ALTER TABLE <%=odiRef.getTable("L", "TARG_NAME", "A") %> DROP CONSTRAINT <%=odiRef.getCK("COND_NAME") %>
The Action Calls methods are usable in the action lines only. Unlike other substitution methods, they are not used to generate text, but to generate actions appropriate for the context.
For example, to perform the a Drop Table DDL operation, we must first
drop all foreign keys referring to the table.
In the Drop Table action, the
first action line will use the dropReferringFKs()
action call method to automatically generate a Drop
Foreign Key action for each foreign key of the current table. This
call is performed by creating an action line with the following code:
<% odiRef.dropReferringFKs(); %>
The syntax for calling the action call methods is:
<% odiRef.method_name(); %>
Note: The action call methods must be alone in an action line, should be called without a preceding "=" sign, and require a trailing semi-colon.
The following Action Call Methods are available for Actions:
addAKs(): Call the Add Alternate Key action for all alternate keys of the current table.
dropAKs(): Call the Drop Alternate Key action for all alternate keys of the current table.
addPK(): Call the Add Primary Key for the primary key of the current table.
dropPK(): Call the Drop Primary Key for the primary key of the current table.
createTable(): Call the Create Table action for the current table.
dropTable(): Call the Drop Table action for the current table.
addFKs(): Call the Add Foreign Key action for all the foreign keys of the current table.
dropFKs(): Call the Drop Foreign Key action for all the foreign keys of the current table.
enableFKs(): Call the Enable Foreign Key action for all the foreign keys of the current table.
disableFKs(): Call the Disable Foreign Key action for all the foreign keys of the current table.
addReferringFKs(): Call the Add Foreign Key action for all the foreign keys pointing to the current table.
dropReferringFKs(): Call the Drop Foreign Key action for all the foreign keys pointing to the current table.
enableReferringFKs(): Call the Enable Foreign Key action for all the foreign keys pointing to the current table.
disableReferringFKs(): Call the Disable Foreign Key action for all the foreign keys pointing to the current table.
addChecks(): Call the Add Check Constraint action for all check constraints of the current table.
dropChecks(): Call the Drop Check Constraint action for all check constraints of the current table.
addIndexes(): Call the Add Index action for all the indexes of the current table.
dropIndexes(): Call the Drop Index action for all the indexes of the current table.
modifyTableComment(): Call the Modify Table Comment for the current table.
AddColumnsComment(): Call the Modify Column Comment for all the columns of the current table.