Insertion relative to SQL processing in a Business Component
You can insert specific processing in the SQL clauses WHENEVER and DECLARE CURSOR. These clauses have a 10 hierarchical level. You must insert subfunctions in the specific function (level 05) that you attached to the FSQL block. In the created subfunctions, you can then insert subfunctions with a lower hierarchical level. It is advised to insert them in relative mode because they will be inserted in the subfunctions that depend on the SQL specific function.
- SQL statements
- Indicate the statement in which the specific processing is to
be inserted:
- WHENEVER SQL statement:
In the Macro code, this specific processing is identified by REF=SQLW. In the Business Component code, it is identified by FSQL-WHENEVER
- DECLARE CURSOR SQL statement: If you select
this statement, you must indicate the Table-type Segment or the SQL
view that contains the specific code to be taken into account.
In the Macro code, this specific processing is identified by REF=SQLD segm (where segm is the selected Segment or SQL view). In the Business Component code, it is identified by FSQL-CURSR-segm (where segm is the selected Segment or SQL view).
- WHENEVER SQL statement:
- Action type
- Specific processing is inserted in a Business
Component relatively to the standard generated processing. You can
then benefit from the generated processing and adapt it to your needs.You must select one of the following values to insert the specific processing:
- Insert before a standard SQL clause.
The specific processing is inserted before the start tag of the standard
processing.
In the Macro code, the positioning of this specific processing is identified by ACTION=*A. In the Business Component code, it is identified by @BEFORE.
- Insert after a standard SQL clause.
The specific processing is inserted before the end tag if the hierarchical
level is greater than the level of the standard processing. It is
generated after the end tag if the hierarchical level is identical
to the level of the standard processing.
In the Macro code, the positioning of this specific processing is identified by ACTION=*P. In the Business Component code, it is identified by @AFTER.
- Replace a standard SQL clause. This
choice can be activated only if no specific subfunction has already
been inserted in the SQL clause relatively to the attachment point
(WHENEVER clause or DECLARE CURSOR clause
on the same Segment). If a specific subfunction has already been inserted
relatively to the attachment point, you must first remove it.
In the Macro code, the positioning of this specific processing is identified by ACTION=*P. In the Business Component code, it is identified by @REPLACE.
- Insert before a standard SQL clause.
The specific processing is inserted before the start tag of the standard
processing.