Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IN or NOT IN (causes C5)
Message
From
17/03/2004 11:41:57
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
IN or NOT IN (causes C5)
Miscellaneous
Thread ID:
00887116
Message ID:
00887116
Views:
46
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) )
Next
Reply
Map
View

Click here to load this message in the networking platform