sponsored links

Collapse

Announcement

Collapse
No announcement yet.

Deletion of records from a multi-member file by condition

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deletion of records from a multi-member file by condition

    Hey. There is a multi-member physical data file. Is there a “simple” way to remove from all its members records that satisfy a certain condition? For example, you must delete all records for which the DATA symbol field contains the text "delete". If there was one member in the file, then I would use something like this SQL expression:
    Code:
    delete from FILE where DATA like '%delete%'
    But in my case there are several members and this expression must be applied to each of them.

  • #2
    Not easily, no. SQL does not have a concept of multi member files.

    SQL will always refer to the *FIRST member - though (I think) it does respect member overrides.

    So the best thing I can think of is to DSPFD FILE(<myfile>) TYPE(*MBRLIST) to an outfile to get a list of members, then loop through that list, then for each member do an OVRDBF to that member, then run the delete SQL

    Comment

    Working...
    X