GAUTAM
asked on
Sybase Stored procedue doubt
Hi Experts...
I have around say 50 variables in a sybase stored procedure whose value is calculated within the stored procedure by a mathematical procedure.
I have a condition such that if the value of the 50 variables is lesser than 10 then the value should be made as 0.
I could do as follows:
if @val1 < 10
select @val1=0
if @val2 < 10
select @val2=0 ...........and so on till 50 values.
Is there a way in sybase to change all these values to 0 if the values of the variables are less than 10 or keep them as it is if they have a value greater than 10.
Please help...
I have around say 50 variables in a sybase stored procedure whose value is calculated within the stored procedure by a mathematical procedure.
I have a condition such that if the value of the 50 variables is lesser than 10 then the value should be made as 0.
I could do as follows:
if @val1 < 10
select @val1=0
if @val2 < 10
select @val2=0 ...........and so on till 50 values.
Is there a way in sybase to change all these values to 0 if the values of the variables are less than 10 or keep them as it is if they have a value greater than 10.
Please help...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'd put the 50 variables into a temp table, one row per variable, then run a single update to apply your logic.