Is there some way I can have a conditional in an update?
I have this update sql (paraphrased):
update LMPROC_LIMITS set LIMIT = sign(LIMIT) * 100 * floor(0.000001 + (sign(LIMIT) * LIMIT * ratio/100) where SYMBOL_ID = symbolId and CLASSTYPE = LimitType and TYPE_ in ('minClusterPosition', 'maxClusterPosition', 'minProductPosition', 'maxProductPosition', 'minBookPosition', 'maxBookPosition', 'maxShortShares')
(ratio, symbolId, and LimitType all are filled in at run time)
What i want to do is limit (no pun intended) the value LIMIT is set to to +/-2,147,483,647 - i.e. if the result of (sign(LIMIT) * 100 * floor(0.000001 + (sign(LIMIT) * LIMIT * ratio/100)) is more or less then that, I want to set it to +/-2,147,483,647 Can I do this in SQL?
Thanks! -larry
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql
Feb 12
hsv Re: Conditional in update
Feb 12, 2014; 17:35
hsv
Re: Conditional in update
Feb 12
Larry Martell Re: Conditional in update
Feb 12, 2014; 21:37
Larry Martell
Re: Conditional in update
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!