Chapter 15 Writing SQL Statements in PowerDesigner


FOREACH_COLUMN

Description

Repeats a statement for each column in the current table fulfilling a condition

Syntax

.FOREACH_COLUMN ("condition")

"statement"

.ENDFOR

Argument Description
condition Column condition (see below)
statement Statement to repeat
Condition Selects
empty All columns
PKCOLN Primary key columns
FKCOLN Foreign key columns
AKCOLN Alternate key columns
NMFCOL Non-modifiable columns (columns that have Cannot Modify selected as a check parameter)
INCOLN Triggering columns (primary key columns, foreign key columns; and non-modifiable columns)

Example

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

.FOREACH_COLUMN("NMFCOL")
-- "%COLUMN%" cannot be modified
.ENDFOR

generates the following trigger script:

-- "TITLE_ISBN" cannot be modified
-- "PUB_ID" cannot be modified

 


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