Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there something like EVALUATE() fox function ?
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01131426
Message ID:
01131433
Views:
15
Thank you, but not so easy, maybe I didn't explain well.

The expression will come from a character field, it isn't known in advance.

Assume you read the formula like this:
Declare @Expr  varchar(100)
Set @Expr = Select cFormula from FeeSetup where .........
@Expr will contain a text like '@var1 + @var2' and if those variables are pre-defined then I want to obtain the evaluation of the expression.

Thanks



>>Hello,
>>
>>I am preparing some dynamic procedures in SQL 2005 but I haven't been able to do something like this (similar to the fox function EVALUATE) :
>>
>>
>>-- Assume this T-SQL code
>>
>>Declare @var1 char(5)
>>Declare @var2 char(10)
>>
>>set @var1 = 'ABCDE'
>>set @var2 = '0123456789'
>>
>>set @expr = '@var1 + @var2'
>>
>>
>>
>>How could I evaluate the expression @Expr in order to print the value 'ABCDE0123456789' and not the formula ???
>>
>>Thanks.
>
>remove the 's
>
>DECLARE @expr char(15)
>Declare @var1 char(5)
>Declare @var2 char(10)
>
>set @var1 = 'ABCDE'
>set @var2 = '0123456789'
>
>set @expr = @var1 + @var2
>
>PRINT @expr
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform