Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use nulls from outer join in SQL Union
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
How to use nulls from outer join in SQL Union
Miscellaneous
Thread ID:
00157837
Message ID:
00157837
Views:
72
I receive the error "Field CBYADDRESS does not accept null values" when I run the SQL command below. This first SQL Select does not return NULLs, but the second one does. Making the second SQL first solves the problem. Unfortunately, I have other queries where the first SQL Select, and/or second one can return NULLs.

I will eventually make these SQL Selects into views. Is there some setting in a view or FoxPro to resolve this error?

Thanks!

SELECT ;
MainCase.DAddress AS cByAddress, ;
MainCase.DCity AS cByCity, ;
MainCase.DState AS cByState, ;
MainCase.DTaxID AS cByTaxID, ;
MainCase.DZip AS cByZip ;
FROM MainCase ;
WHERE MainCase.Office + MainCase.CaseNo = ?gcOfficeCaseNumber ;
UNION ALL ;
SELECT ;
Joint.JDAddr, ;
Joint.JDCity, ;
Joint.JDState, ;
Joint.JDTaxID, ;
Joint.JDZip ;
FROM ;
MainCase LEFT JOIN Joint ;
ON Joint.Office + Joint.CaseNo = MainCase.Office + MainCase.CaseNo ;
WHERE MainCase.Office + MainCase.CaseNo = ?gcOfficeCaseNumber
Next
Reply
Map
View

Click here to load this message in the networking platform