Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does SQL work but CREATE SQL VIEW doesn't
Message
De
01/10/1999 18:28:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Why does SQL work but CREATE SQL VIEW doesn't
Divers
Thread ID:
00271803
Message ID:
00271803
Vues:
59
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform