|
This is "my complication" on this simple SQL:
=======================================================
FILE:ITEMBL
FIELDS:
ITNBR - ITEM NUMBER (KEY FIELD)
HOUSE - WAREHOUSE (KEY FIELD)
ITCLS - ITEM CLASS
FILE:ITMRVA
FIELDS:
ITNBR - ITEM NUMBER (KEY FIELD)
STID - SITE ID
ITCLS - ITEM CLASS
Goal: Update ITCLS in ITEMBL with ITCLS in ITMRVA only if:
a) STID = 'J2P'
b) HOUSE = 'JTG'
c) ITEMBL.ITCLS <> ITMRVA.ITCLS =======================================================
This is the SQL I am doing:
UPDATE ITEMBL A SET A.ITCLS = (SELECT ITCLS FROM ITMRVA B WHERE A.ITNBR = B.ITNBR AND B.STID = 'J2P'
AND A.ITCLS <> B.ITCLS
)
WHERE A.ITNBR = B.ITNBR AND A.HOUSE = 'JTG' ? The error I am having is: COLUMN QUALIFIER OR TABLE B UNDEFINED. If I remove the "B" qualifier from the last B.ITNBR in the SQL, then I have this error instead: NULL VALUES NOT ALLOWED IN COLUMN
OR VARIABLE ITCLS.
I can't see what I am doing wrong ... HELP! Thanks in advance!
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.