Delete Physical file member data (selected)

I have a physical file in AS/400 machine which has a member which contains history data. I tried to delete few records from the member using SQL statement. but there is no place to enter the member name in the SQL statement. So I need to know a method to delete few selected records in the file member. Please advise me.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 4 &nbspReplies

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

SQL has no concept of "members". You generally shouldn't use multi-member files for SQL processing. However, you can run OVRDBF to override a file to a specific member before running a SQL statement, and SQL will honor the override. You can also run a SQL CREATE ALIAS statement to create a more permanent object reference to a member; then run your statement against the ALIAS. -- Tom

CREATE ALIAS makes sense to me when the intention is to create a permanent object. For example, members might exist for CURRENT and PREVIOUS data, and those two will always be the same. Or there might always be 12 months of data that you will name JANUARY, FEBRUARY, etc.
An ALIAS can be created in QTEMP in order to make it effectively temporary, but all of the overhead of creating a permanent object, including setting ownership and authorities still happens by default. As a permanent object, attributes ought to be managed.
An override is intended to be temporary. Its effects are specifically limited to the current job. No additional overhead is involved. All effects are applied only to whatever ODP is created in the job. The only extra overhead is the minimum updating of fields in the ODP that exists.
Also, an ALIAS necessarily has a different name from the object. That can have implications in the future if the database is re-engineered. Ideally, the ALIAS name could be the name used for some future VIEW that might replace 'members' in the future. That would help make potential code re-engineering easier.
It can be a little more difficult to enter an override than to create an ALIAS if you are within STRSQL, but fairly immediate access can be obtained by running CALL QUSCMDLN from the SQL command line or by accessing an attention program or other means. (For QUSCMDLN, or QCMD or whatever, the affects of invoking as a stored proc might vary with the OS version; and it should be tested first.)
There are factors to the choice of override or CREATE ALIAS. It might be personal preference, but it should take the system environment into consideration.
Tom

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

Share this item with your network:

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy