Macro Variables

Common variables used in the macro syntax are:

  • <default value>, <value>, and <initial value> represent a user-specified text or numeric value, which appears exactly as written when the macro code is expanded.
  • < action> represents a valid SQL action (such as INSERT, UPDATE, or DELETE).
  • <function> name of the program or subroutine that you call to perform an action as shown in the SQL Server example below:

Syntax Example

Expansion

%Atts(" or ",update,%Parent)

update(MOVIE_COPY.master_number) or update(MOVIE_COPY.movie_copy_number)

  • <macro code>, <macro code1>...<macro coden> represents any macro code sequence that is valid in the current scope. When multiple macro code sequences can be included in the same command, they are numbered from 1 to n.
  • <predicate> represents any valid Boolean expression that evaluates to TRUE or FALSE, including those supported directly by an erwin DM macro (such as %ColIsFK) and those created using supported Boolean operators such as %<comparison op>(,), and other comparison operators %And(,), %Or(,), and %Not().
  • <prefix>, <old prefix>, <new prefix> represents a text or numeric value (such as @ins) or expanded macro (such as %Parent) that is added to the beginning of a table or column name when the macro code is expanded. If both old and new prefix elements are specified, the list created by the macro has two sections: The first section declares <old prefix> <element>, the second section declares <new prefix> <element>.
  • <separator> represents one or more characters used to delimit a list created by the macro. Separators are set off by quotation marks (such as "OR").
  • <table name>, <default name>, <domain name>, <validation> are replaced by the name of an erwin DM table, default, domain, or validation rule or the corresponding macro (such as %TableName, %Child, %DefaultName, %DomainName, %ValidationName).
  • <variable> name used within the template.