August 2, 2007 at 11:28 am
Is there a way to pass an expression to a stored procedure.
Ex. stored procedure usp_XXX is expecting numeric parameters
exec usp_xxxx 9.9 works fine,
What want is...
exec usp_xxxx @x * 2.5 (@x is variable declared as dec(8,0)
I know, I can set @x = @x * 2.5 and then exec usp_XXXX @x
August 2, 2007 at 12:01 pm
August 2, 2007 at 12:44 pm
The stored procedure is used in triggers on multi-databases. In most cases, there is not a need to pass it an expression. The developer did not want to have to create new variables to hold the results of the expression to pass to the stored procedure.
August 2, 2007 at 12:49 pm
How come you don't want to do it the way you show in your example? That is to set the value of the variable to whatever you want and then pass the variable.
August 2, 2007 at 1:16 pm
The exact thing the developer is trying to avoid doing here is the way to do it. Why would the developer want to avoid creating a variable to hold this in? I don't get it. That's what variables are for right?
August 2, 2007 at 1:22 pm
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply