Hi John,
The problem is that macro substitution is not supported on SQL. Am I right here?
>Hi Don ---
>
>What a cool, novel idea! So, have a table with a memo field, write the SQL to that memo field and then have the back-end process it as a stored procedure? Interesting. What you could have on the SQL Server end is an sp_ where it opens the record and does the SELECT statement from that setup table using a variable to represent the entire text and then passes the cursor back when called from SQLEXEC in VFP. I don't see why that wouldn't work.
>
>>
>>I had one other idea after the UT crashed yesterday... (had major problems staying connected). Is it possible to do something similar to a macro substitution in SQL like in VFP with the use of the &?
>>Ex: lcTable = "employee"
>> use &lcTable
>>
>>My thought was to create a table with an ID and a text field (compatible with VFP memo field). Then I could create a view on the front end, add a record with the full string desired and commit the record to the back end... Then with that ID assigned, I could call a stored procedure on the back-end and select the value from the text into a variable and execute from there? Is this possible?
Edward Pikman
Independent Consultant