Products Downloads


French version


 

Level 2 generation in SQL access mode

 

Note: When the logical entity has a default logical server, the instructions directly related to the entity will be assigned automatically to the logical server, except in the SFTKYS_PROCESS sections.

In the example below, <S1> is the default logical server of ENTITY1, and <S2> is the default logical server of ENTITY2.

Only the lines in purple refer to the instructions generated by level 2 generation.

 

Typical structure

 

* For the window

 

BEGIN_STD_DFL

 

BEGIN_STD

<S1>

< generation of the VP-class management rules

 

for non-list fields >

 

END_STD

<S1>

CHAIN_SQL ENTITY1 *COND(E1_FIELD1 = :E1_VAR_HOST1 AND....)

<S1>

SQL_RET_CODE = *SQLCODE

<S1>

 

<S1>

BEGIN_STD ENTITY1

<S1>

BRING_BACK ENTITY1

<S1>

< generation of the VE-class management rules for the ENTITY1 entity >

<S1>

END_STD

<S1>

 

<S1>

 

<S1>

IF     SQL_RET_CODE = *NORMAL

<S1>

UPD_SQL ENTITY1 *ALL *COND(E1_FIELD1 = :E1_VAR_HOST1 AND....)

<S1>

ELSE

<S1>

IF   SQL_RET_CODE = *NOT FOUND

<S1>

CREATE_SQL ENTITY1

<S1>

END

<S1>

END

 

END_STD_DFL

 

 

 

* For a list

 

BEGIN_STD_DFL

 

READ_LST <window.object:list_prop> *MODIF

 

BEGIN_STD

<S2>

< generation of VP-class management rules for list fields >

 

END_STD

 

 

<S2>

READ_SQL ENTITY2 *COND(E2_FIELD1 = :E2_VAR_HOST1 AND....)

<S2>

SQL_RET_CODE = *SQLCODE

<S2>

 

<S2>

BEGIN_STD ENTITY2

<S2>

BRING_BACK ENTITY2

<S2>

< generation of the VE-class management rules for the ENTITY2 entity >

<S2>

END_STD

<S2>

 

<S2>

IF     SQL_RET_CODE = *NORMAL

<S2>

UPD_SQL ENTITY2 *ALL *COND(E2_FIELD1 = :E2_VAR_HOST1 AND ....)

<S2>

ELSE

<S2>

IF   SQL_RET_CODE = *NOT FOUND

<S2>

CREATE_SQL ENTITY2

<S2>

END

<S2>

END

 

END_READ_LST

 

END_STD_DFL

 

Note: As regards the VP-class management rules, the $PROP (properties) on the screen will be replaced by the screen field guide words; otherwise, they will be replaced by the file field guide words.

As regards the VE-class management rules, the $PROP (properties) will be replaced by the file field guide words.

 

Important: When referring to "screen field guide words" with VADELIA or MADELIA programs, it corresponds to the value property of the graphical object (the "screen field") or, if the graphical object has one, to the name of its associated variable.

With WADELIA programs, this is the graphical object's name.

 

 

Click below for further information about:

 

↑ Top of page


  • Aucune étiquette