Syntax of CONSTRUCT instruction
The CONSTRUCT
instruction provides database
query by example, producing a WHERE
condition for SELECT
.
Syntax
CONSTRUCT { BY NAME variable ON column-list
| variable ON column-list FROM field-list
}
[ ATTRIBUTES ( { display-attribute
| control-attribute }
[,...] ) ]
[ HELP help-number ]
[ dialog-control-block
[...]
END CONSTRUCT ]
where column-list defines a list of database columns
as:
{ column-name
| table-name.*
| table-name. column-name
} [,...]
where field-list defines a list of fields with one or more
of:
{ field-name
| table-name.*
| table-name.field-name
| screen-array[line].*
| screen-array[line].field-name
| screen-record.*
| screen-record.field-name
} [,...]
where dialog-control-block is one
of:
{ BEFORE CONSTRUCT
| AFTER CONSTRUCT
| BEFORE FIELD field-spec [,...]
| ON CHANGE field-spec [,...]
| AFTER FIELD field-spec [,...]
| ON IDLE seconds
| ON TIMER seconds
| ON ACTION action-name
[ INFIELD field-spec ]
[ ATTRIBUTES ( action-attributes-construct ) ]
| ON KEY ( key-name [,...] )
}
dialog-statement
[...]
where action-attributes-construct
is:
{ TEXT = string
| COMMENT = string
| IMAGE = string
| ACCELERATOR = string
| DEFAULTVIEW = { YES | NO | AUTO }
| CONTEXTMENU = { YES | NO | AUTO }
[,...] }
where dialog-statement is one
of:
{ statement
| NEXT FIELD { NEXT | PREVIOUS | field-spec}
| CONTINUE CONSTRUCT
| EXIT CONSTRUCT
}
where field-spec identifies a unique field with one
of:
where
display-attribute
is:{ field-name
| table-name.field-name
| screen-array.field-name
| screen-record.field-name
}
{ BLACK | BLUE | CYAN | GREEN
| MAGENTA | RED | WHITE | YELLOW
| BOLD | DIM | INVISIBLE | NORMAL
| REVERSE | BLINK | UNDERLINE
}
where control-attribute
is:
{ ACCEPT [ = boolean ]
| CANCEL [ = boolean ]
| FIELD ORDER FORM
| HELP = help-number
| NAME = "dialog-name"
}
- variable is the variable that will contain the SQL condition built by the
CONSTRUCT
instruction. - column-name is the identifier of a database column of the current form.
- table-name is the identifier of a database table of the current form.
- field-name is the identifier of a field of the current form.
- screen-array is the screen array that will be used in the current form.
- line is a screen array line in the form.
- screen-record is the identifier of a screen record of the current form.
- help-number is an integer that allows you to associate a help message number with the instruction.
- key-name is a hot-key identifier (like
F11
orControl-z
). - dialog-name is the identifier of the dialog.
- action-name identifies an action that can be executed by the user.
- seconds is an integer literal or variable that defines a number of seconds.
- statement is any instruction supported by the language.
- action-attributes are dialog-specific action attributes.