Products Downloads


French version


 

 

ADELIA

      

      

      

      

(I/B)

 

 

 

 

 

Warning: This instruction must be used in the description of a macro-instruction, a program template or a management rule. It is accepted in Visual Adelia and Adelia Web if it is placed in a management rule with an ADELIA-compatible source type.

 

Section for use

All

 

Syntax

DEFINE_VIEW ViewName File FileAccess InfoDSOpt OpenOpt InfSrOpt CommitOpt BlockOpt

 

FileAccess

KEY SeriesAccessField

 

 

| DIRECT NumVar

 

 

| SEQ

     

SeriesAccessField

SeriesAccessField ;VarGuideWord

 

 

| SeriesAccessField VarDDSName

 

 

| SeriesAccessField

 

 

| VarDDSName;VarGuideWord

 

 

 

NumVar

;NumVarGuideWord

 

 

| NumVarDDSName

 

 

| NumVarDDSName;NumVarGuideWord

     

InfoDSOpt

INFODS | None

 

 

 

OpenOpt

OPEN | None

 

 

 

InfSrOpt

INFSR;ProcedureName | None

 

 

 

CommitOpt

COMMIT | None

 

 

 

BlockOpt

BLOCK_YES | BLOCK_NO | None

 

 

Description

This instruction is used to declare a view from a macro-instruction, a program template or a management rule.

 

The following must be declared:

    • the guide word of the view ViewName,

    • the name of the database file File,

    • the file FileAccess access type,

    • the fields which constitute the key to this view.

 

The possible values for FileAccess are:

    • KEY for access by key,

    • DIRECT for direct access,

    • SEQ for sequential access.

 

Optional parameters:

    • INFODS to use the file's Info DS,

    • OPEN to open the file explicitly,

    • INFSR followed by the name of a procedure, where INFSR is used for the file concerned,

    • COMMIT so that the file will be opened in commitment control mode,

    • BLOCK_YES or BLOCK_NO keywords control the blocking of records associated with the file.

 

Example

* Management rule CONTROL_ITEM

DECLARE WITEMC;W_ITEM_CODE 7

DEFINE_VIEW ITEM_CONTROL ITEML1 KEY ;W_ITEM_CODE

W_ITEM_CODE = $$FIELD

CHAIN ITEM_CONTROL

IF   ITEM_CONTROL DOES_NOT_EXIST

PREPARE_MSG CTL0024 $$FIELD

INIT_MSG $$FIELD

ANOMALY

END

 

Other possibilities:

 

DEFINE_VIEW CUSTOMERS CUSTOML1 KEY ZCUSCO ;ZCUST_CODE

 

DEFINE_VIEW CUSTOMERS CUSTOML1 KEY ZCUSCO ;ZCUST_CODE INFODS OPEN

 

DEFINE_VIEW ORDERS_VIEW ORDERP SEQ INFODS INFSR;ERRLOG

 

See also the list of 4GL instructions by topic

↑ Top of page

  • Aucune étiquette