Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The COZZI - Delete Records (DLTRCD) command deletes records from the specified database file member. It uses either an SQL style WHERE clause or a comparison value to a position in the database record.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FILE | Database file name | Qualified object name | Required, Positional 1 |
Qualifier 1: Database file name | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MBR | Member | Name, *FIRST | Optional, Positional 2 |
WHERE | SQL WHERE Clause for Delete | Character value, *NONE | Optional, Positional 3 |
DLTREL | Delete Records when | Single values: *NONE Other values: Element list |
Optional, Positional 4 |
Element 1: Character position in record | 1-32766 | ||
Element 2: Boolean comparison | *EQ, *NE, *LT, *LE, *GT, *GE | ||
Element 3: Value | Character value |
Top |
Top |
Specifies the name of the member in the database file specified on the FILE parameter whose records are deleted.
Top |
Specifies an SQL WHERE condition to delete the records. Any valid SQL WHERE clause for the designated file may be specified including but not limited to comparisons, ranges, generic or compound conditions.
EXEC SQL DELETE FROM LLLL/FFFF WHERE wwwwwwwwwwwwwwwww;
The DELETE statement is generated (as illustrated above) and contains the file's library name (LLLL) the File name (FFFF) and the WHERE keyword.
Top |
Specifies a position within each database record that is compared to the value specified on this parameter. If that comparison matches, then the record is deleted. For example: DLTREL(1 *EQ 'D') causes records that contain the letter 'D' in position 1 to be deleted. This parameter is ignored if the WHERE parameter is specified.
Single values
Element 1: Character position in record
Element 2: Boolean comparison
Element 3: Value
DCL VAR(&COMPVALUE) TYPE(*CHAR) LEN(10) CHGVAR VAR(&COMPVALUE) VALUE('D') DLTRCD FILE(QGPL/MYMASTER) DLTREL(42 *EQ %TRIMR(&compvalue))
Top |
Top |
Top |