Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IN or NOT IN (causes C5)
Message
De
17/03/2004 11:41:57
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
IN or NOT IN (causes C5)
Divers
Thread ID:
00887116
Message ID:
00887116
Vues:
48
I have a query where the view parameter is used to generate a subquery:
SELECT OrderID FROM Orders ;
 WHERE Orders.OrderID IN ;
 (SELECT OrderID FROM LineItems ;
  WHERE LineItems.ItemID = ?vp_ItemID)
This works just fine, but I want to be able to supply whether vp_ItemID is IN/NOT IN the subquery. After multiple attempts, many of them causing C5s, I'm here looking for a way to accomplish this.


The following code in the View Designer causes a C5 on VFP8 SP1/Win2K SP4.
SELECT OrderID FROM Orders ;
  WHERE IIF(vp_ItemID < 0, ;
  Orders.OrderID NOT IN ;
    (SELECT OrderID FROM LineItems ;
     WHERE LineItems.ItemID = ABS(?vp_ItemID)), ;
  Orders.OrderID IN ;
    (SELECT OrderID FROM LineItems ;
     WHERE LineItems.ItemID = ?vp_ItemID) )
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform