ADELIA |
VADELIA |
SADELIA |
WADELIA |
MADELIA |
(I/B) |
(I/B) (S) |
(B) (S) |
(I/B) (S) |
(I) (S) |
Warning: In the case of ADELIA programs, this instruction is only compatible with the RPG generator.
Section for use
All
Syntax
DELETE_SQL EntityName AdeliaCondition Parameter
Parameter |
Þ |
*NO_MR | *MR | None |
Description
This instruction deletes the record or records from the entity EntityName, obeying the (optional) condition AdeliaCondition.
It is equivalent to the SQL instruction: "Delete from EntityName where AdeliaCondition".
For programs other than ADELIA, you can also check that the record is not locked, by testing it with the
*LOCKED reserved word.
The *MR parameter allows you to generate deletion implicit management rules that are linked to the entity, even if the program is generated without the option to generate implicit management rules.
The *NO_MR parameter allows you not to generate deletion implicit management rules that are linked to the entity, even if the program is generated with the option to generate implicit management rules.
After this instruction has been run, it is possible to test the SQL return code with the *SQLCODE reserved word.
Example
DELETE_SQL ORDER_LINE *COND(ORD_NUM = :ZORD_NUM)
Other example
(VADELIA or WADELIA program)
* Read loop on the list to collect
* all the selected lines
READ_LST PERSO_LST:LIST *SELECT
* send msg to box with reply yes or no
SEND_MSG INF0007 *BOX(*YES_NO, W_REP, 2)
IF W_REP = *BTN_YES
DELETE_SQL PERSONNEL *COND(PE_IDNBR_CODE=:ZZ_IDNBR_CODE)
DELETE_ELT PERSO_LST:LIST
END
*
END_READ_LST