Chapter 15 Writing SQL Statements in PowerDesigner


FOREACH_PARENT

Description

Repeats a statement for each child-to-parent reference in the current table fulfilling a condition

Syntax

.FOREACH_PARENT ("condition")

"statement"

.ENDFOR

Argument Description
condition Reference condition (see below)
statement Statement to repeat
Condition Selects references defined with ...
empty All references
FKNULL Non-mandatory foreign keys
FKNOTNULL Mandatory foreign keys
FKCANTCHG Non-modifiable foreign keys

Example

In a trigger for the table SALE, the following macro:

.FOREACH_PARENT("FKCANTCHG")
--  Cannot modify parent code of "%PARENT%" in child "%CHILD%"
.ENDFOR

generates the following trigger script:

--  Cannot modify parent code of "STORE" in child "SALE"
--  Cannot modify parent code of "TITLE" in child "SALE"

 


Copyright (C) 2005. Sybase Inc. All rights reserved.