GAUTAM
asked on
Checking conditions in Sybase Stored Procedure
Hi Experts...
I have around 52 values among which are half of them are of type int and the other half are float.
I need to check whether all the integer values are 0 and all the float values are 0.0 which in this case i need to update the 52 columns as null.
How can i easily check this condition.
Is the syntax just to compare as follows: if( val==0 && val2==0.0....and so on).
Is ther an efficient way to do the same.
Can anyone give syntax for the same.
Please help...
I have around 52 values among which are half of them are of type int and the other half are float.
I need to check whether all the integer values are 0 and all the float values are 0.0 which in this case i need to update the 52 columns as null.
How can i easily check this condition.
Is the syntax just to compare as follows: if( val==0 && val2==0.0....and so on).
Is ther an efficient way to do the same.
Can anyone give syntax for the same.
Please help...
ASKER
@Jan_Franek:Thanks for the reply.
I need to do this check before updating about 5 million records.
How much time consuming is this process.
Will it increase overall execution time.
I need to do this check before updating about 5 million records.
How much time consuming is this process.
Will it increase overall execution time.
What exactly are you going to check ? Values in database table (5 million times 52 values) ? Or just stored procedure parameters (1 times 52 values) ?
ASKER
@Jan_Franek:Thanks for the reply.
I am going to check values sent to the stored procedure.
Since there are 5 million records I'll have to call the stored procedure (5 million times 52 values).
Please help...
I am going to check values sent to the stored procedure.
Since there are 5 million records I'll have to call the stored procedure (5 million times 52 values).
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.
IF @val1 = 0 and @val2 = 0.0 ...
or you can just add up absolute values and then check the sum
IF ( abs(@val1) + abs(@val2) + .... ) = 0.0