Discussion Locked

AS400 SQL - how to select a member

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I may try to delete records from an AS400 DB2 physical file, which has 10 members. I only want to delete records from member number 10, but my script only reads the first member in the file.

I have tried the following combinations of brackets and spaces and dots between the file name and memebert name etc. But none of it works

delete from lib/file (member) where chdrnum = '50146382'

6 replies

by 20 + years

Try

Delete from member where chdrnum = '50146382';

This assumes member is your table name. I hope it works.

by jppk2

The correct solution is to write a 2 line CL program, using the OVRDBF command followed bt the RUNSQL command.

by jppk2

Write a 2 line CL program. Use the OVRDBF command to rename the file to having only one member, i.e. member 10. Then on the second line of the CL use the RUNSQL command. This works !!

This discussion is closed to new replies.