Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create SQL View (embed variable) best way q
Message
From
13/03/2008 11:34:19
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01301700
Message ID:
01301766
Views:
12
>>>>Macro substitution sadly does not work and the string length is too long for concat process.
>>>>How would you create my view with my vars?
>>>
>>>text to lcSQLCmd textmerge noshow
>>> ... substitute all variables with <<var>>
>>>endtext
>>>
>>>then
>>>
>>>&lcSQLCmd
>>>
>>>Or if the length of lcSQLCmd exceeds 8K:
>>>
>>>execscript(lcSQLCmd)
>>
>>Not working
>>lcSQLCmd variable does not exist at macro attempt
>>execscript is not an option in VFP6
>>
>>I defined lcSQLCmd but the macro still fails.
>>
>>What am I missing here?
>
>text to unfortunately was introduced in VFP8 version. I guess you would have to create your lcSQLCommand in pieces then, or use textmerge command slightly different way.
>
>Or just generate it into file and then run it.


Two suggestions
(1) I use &?par in views for a where clause. Might work
(2) The sql command can be in one piece provided you put a few markers in it
eg

stmt = [select * from table where (name = "%%name%%")]
stmt = strtran(m.stmt, [%%name%%], [Nadya])
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform