The aim is to retrieve the selected information from a specified query, and to automatically load the subfile.
Two types of control are handled by Adelia:
Loading by static query: the SQL query specifications are written in the Adelia model.
Loading by dynamic query: the query is composed and processed when the model is executed.
You must initially specify that you wish to use an SQL query to fill-in a subfile, whether by static or dynamic query.
This must be stated at the view control level of the model, in the definition of the view representing the subfile load (view of the type *n).
For example
View *1 of a program
Define SQL access in a subfile-type view
Notes:
-
- Only the fill-in criteria ("By SQL request") need to be specified.
- No (guide) file should be associated.
- The file will be declared at the SQL instruction level.
This remark is also true for the data flow when the data is gathered together. There is no point in gathering the subfile fields present in the subfile in a specified view, as they are loaded automatically by the declaration of SQL loading instructions in the model.
Once the view control has been defined, one must then specify the Adelia instructions which will be used in the model to load the subfile via an SQL query.
These instructions must be placed in the INITIALIZATION block of the corresponding transaction, before any standard control instructions of subfiles ( MANAGE_SFL, END_MANAGE_SFL, etc.). They must be entered manually after generating the Level 2 model.
The Adelia instructions which control the SQL query can only be specified once per subfile.