Hi Naomi,
Here it is. I think I have my solution but I don't mind learning something new if I can create the view programatically without having to create the cursor as well (not that that is a big deal). So here is the cursor used for the subquery:
CREATE CURSOR c_QuotesToDelete ( Quote_ID N(6), Description C(35), DeletedOkay L(1) )
>Albert,
>
>Would you please provide the definition of the cursor? If you're using VFP9 (and probably it can be done in previous versions too) you don't need a separate cursor, you can do it in one statement.
>
>>I thought of that after sending my last note...and yes, if I create my cursor right before running the CREATE SQL code, it works. See my later reply with some speed results.
>>
>>Thanks,
>>Albert
>>
>>>Can you create the cursor right before that?
>>>
>>>>
>>>>I get a failure when trying to create the view programmatically as the "c_QuotesToDelete" is a cursor which doesn't exist at the time the view is created. And so this command fails:
>>>>
>>>>
>>>>CREATE SQL VIEW v_PartFileQuoteHeaders AS ;
>>>> SELECT ;
>>>> Quotes.Quote_ID ;
>>>> FROM Quotes JOIN c_QuotesToDelete ON Quotes.Quote_ID == c_QuotesToDelete.Quote_ID
>>>>
>>>>