Personally I would use qsh or pase because I'm familiar with that. But if you want to do it in sql, you could do it in two steps. A query like this in RSS will give you a list of statements. You can copy the statements from the results window up into the workspace, and then run all the statements.
SELECT 'drop table kevin.' concat trim(OBJNAME) concat ';' FROM
TABLE(QSYS2.OBJECT_STATISTICS('KEVIN', '*FILE'))
where date(objcreated) >= '2010-08-03';
That gave these results:
drop table kevin.AAMU;
drop table kevin.AATD;
drop table kevin.ASACHECK42;
drop table kevin.ASACHECK68;
drop table kevin.ASASMC24AL;
Which I cut and pasted up into the workspace, and ran them all with no problems.
On Tue, 2021-09-28 at 09:55 -0400, frank boke wrote:
Hi Folks, is there any way to do this in sql?
I have files created on 9/2/21 in lib fbtemp and I want to use sql to
delete the files dated 9/2/21. How can I use sql to delete the files based
on the date or must I use qsh? I don't want to use cl if I don't have to
because it'd be easier using sql.
Thanks, Frank
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp]
Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550<tel:985-893-2550>
Toll Free: 877-893-2550<tel:877-893-2550>
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
As an Amazon Associate we earn from qualifying purchases.