Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does SQL work but CREATE SQL VIEW doesn't
Message
From
01/10/1999 18:28:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Why does SQL work but CREATE SQL VIEW doesn't
Miscellaneous
Thread ID:
00271803
Message ID:
00271803
Views:
62
Hi. I just noticed some wierd behavior. My SQL is based on two unrelated tables. I am trying to create a VIEW with both tables - the Customer table and the Vendor table - with an additional field designating whether it is a customer or vendor. The fields themselves are the same name (or practically). When I run it from the command line as a SELECT ....FROM ... UNION ALL (SELECT .. FROM ...) it works. Yet when I add the CREATE SQL VIEW test AS (SELECT ... FROM ...UNION ALL (SELE ... FROM ...)) it gives me one of two errors - either a connectivity error or an invalid SQL. I've tried the EVIEW.APP too and it gives me the same problem. Does anyone know why?

The following is the actual SQL:

Select arcust.custno as cusven, arcust.company1, arcust.company2, ;
arcust.address1, arcust.address2, LEFT(arcust.city,30) as city, arcust.prov, arcust.country, arcust.postcode, 'AR' as type FROM arcust ;
UNION ALL (select apvend.vendno as cusven, apvend.company1, apvend.company2, apvend.address1, ;
apvend.address2, apvend.city, apvend.prov, apvend.country, apvend.postcode, 'AP' as type from Apvend)

TIA

Sandi
Next
Reply
Map
View

Click here to load this message in the networking platform