Page tree
Skip to end of metadata
Go to start of metadata

This method deletes the currently positioned record, or the record specified by the search argument.

Parameters
  1. Search argument (optional) - A Number, String, or Array value that specifies the relative-record number or key values for the record to delete.
    1. RLA via SQL does not support delete by relative-record number.
  2. 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'
  pjs.defineTable("myfile", { keyed: true, read: true, delete: true });
  myfile.delete([123, "abc"]);

RPG Equivalent

DELETE

Requirements

This API requires the Profound.js Connector module.