Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution in views
Message
From
28/03/2002 10:15:46
 
 
To
28/03/2002 08:54:26
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00638376
Message ID:
00638461
Views:
37
Hi Christian,

We do this all of the time. I have seen the problem you have and I believe it is because the variable is in memory at the time you create the view, hence the macro substitution occurs.

Try this.

DO NOT define lcSearchstring.

Create the view first.

Then define your search string as you see fit.

Hope this helps,

Ken

>
lcSearchString = " 1=1 "
>CREATE SQL VIEW VBooks AS ;
>	SELECT	B.caKey, ;
>		B.caISDN, ;
>		B.caTitle, ;
>		AU.auName, ;
>		PU.puName, ;
>		CA.caName ;
>	FROM Books B ;
>		LEFT OUTER JOIN Authors AU ;
>		ON B.caauKey = AU.auKey ;
>		LEFT OUTER JOIN Publish PU ;
>		ON B.capukey = PU.pukey ;
>		LEFT OUTER JOIN Categor CA ;
>		ON B.cacakey = CA.caKey ;
>	WHERE &lcSearchString ;
>	ORDER BY B.caTitle, B.caISDN
>USE VBooks
>The problem is, that the variable lcSearchString is evaluated only at the moment of the view definition. I cannot change this value and do the following:
>
lcSearchString = " B.caKey = 5 AND B.caTitle = 'Test' "
>REQUERY("VBooks")
>How can I do that?
Previous
Reply
Map
View

Click here to load this message in the networking platform