file.delete()
Â
This method deletes the currently positioned record, or the record specified by the search argument.
Parameters
Search argument (optional) - A Number, String, or Array value that specifies the relative-record number or key values for the record to delete.
RLA via SQL does not support delete by relative-record number.
Record format name (optional) - A String value that specifies the record format name. If the search argument is not specified, the record format name given must be the name of the last record read from the file.
Exception Handling
An Error instance will be thrown with the following properties:
message - The message text.
error - The message id.
help - The message help text.
Examples
Delete currently positioned record
pjs.defineTable("myfile", { read: true, delete: true });
myfile.fetchNext();
myfile.delete();
Â
Delete relative record number 123
pjs.defineTable("myfile", { read: true, delete: true });
myfile.delete(123);
Â
Delete record with key 'abc'
pjs.defineTable("myfile", { keyed: true, read: true, delete: true });
myfile.delete("abc");
Â
Delete record with keys 123, 'abc'
RPG Equivalent
DELETE
Requirements
This API requires the Profound.js Connector module.