Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete records from one file

Status
Not open for further replies.

arrow483

MIS
Mar 17, 2004
155
US
I want to delete records from file SLALLO, but not MBADREP. Fields ADxxxx are in the MBADREP file. The "select" works. What do I need to make it delete?

delete from SLALLO, MBADREP where ADAKDT > 1040731 and ADUUQ1
> 0 and ADZ93N < ADUUQ1 and ADA3CD like '4%' and ADAENB=CONO and
ADDCCD=ORTP and ADCVNB=ORDNO and ADFCNB=ITMSQ and ADHFCD < '50'
 
I believe you will need to use a subquery for this eg:

DELETE FROM SLALLO
WHERE SLALLO.columnname =

(or IN if many will be returned by the following)

(
SELECT MBADREP.columname
FROM MBADREP

(which is the same datatype as SLALLO.columnname)

WHERE ADAKDT > 1040731
AND ADUUQ1 > 0
AND ADZ93N < ADUUQ1
AND ADA3CD like '4%'
AND ADAENB=CONO
AND ADDCCD=ORTP
AND ADCVNB=ORDNO
AND ADFCNB=ITMSQ
AND ADHFCD < '50'
)

or something like that (difficult to tell wihtout knowing the schema).

Snowcrash
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top