Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Nested Selects
Message
From
11/10/1999 13:19:12
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00274983
Message ID:
00275002
Views:
26
>>>I could have sworn I did this before. I must have my syntax wrong:
>>>
>>>SELECT * FROM Depts WHERE Div_Code IN (SELECT DISTINCT Div_Code FROM NewDivs) INTO CURSOR NewDepts
>>>
>>>TIA
>>
>>The code works fine for me. What is happening?
>
>VFP is complaining that I need to create NEWDIVS with SELECT...TO TABLE, whereas I am using SELECT...TO CURSOR.
>
>Oooohhh! I think I see what's happening! I created NewDivs with a SELECT statement (SELECT * FROM Divs WHERE Proj_No = "20524.00" INTO CURSOR NewDivs) - but instead of creating a new table, VFP did a USE AGAIN on the original table with a filter (baaad fox)! I'll need to alter my first select statement in such a way to prevent VFP from doing that.
>
>I seem to remember an article about this many, many moons ago.
>
>I'd like to do it without altering the structure of the cursor, since I'm ultimately gonna APPEND FROM it. Any suggestions?

You could add a NOFILTER, but I've heard that doesn't always work. You could also add a , .T. to your field list. It will create exp_nn which would make sure that you get your non-filtered table and the field would never be appended.

HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform