Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there something like EVALUATE() fox function ?
Message
From
24/06/2006 21:06:34
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01131426
Message ID:
01131451
Views:
21
Thanks Sergey,

Exactly, I am calling sp_executesql and one of the input parameters has to be a string, but this string is a variable expression which needs to be evaluated for the stored procedure to work fine because the stored procedure is called inside a loop.

@expr = '@var1 + @var2' in the first loop, and next loop it may be:
@expr = '@var1 + @var2 + @var3 + @var4'


In some way, @expr is made of different variables but I need to convert it into only one: the evaluated expression.

Thanks any way.

Juan


>Hi Juan,
>
>There's nothing in SQL Server like VFP EVALUATE(). Your alternative is to run dynamic t-sql code using EXECUTE() or sp_executesql.
>
>
>>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.
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform