|
Joe,Absolutely, Sean. The problem is that some tools (like Jasper) don't have the facility to create a view and then execute a select. They only have room for a single SQL statement. Or at least I've never gotten multiple statements to work.
I know what you mean, but it can be done if you introduce a View: -
Create View QTEMP/MYORDS as
with ORDSELECT as (select ORDCUST, ORDERNUM from ORDERS where
-- some complex criteria --),
CUSTSELECT as (select CUSTNUM from CUSTOMERS where
-- some more complex criteria --),
PURGEABLEORDERS as (select ORDERNUM from
ORDSELECT join CUSTSELECT on ORDCUST = CUSTNUM where
-- some final selection criteria --)
Select * from PURGEABLEORDERS;
update ORDERS set ORDPURGED = 'Y' where
ORDERNUM in (select ORDERNUM from QTEMP/MYORDS);
Sean
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.