添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
update table_name
set col1=1.018*141*power(col2*0.01131/0.7, -0.329) * power(0.993,col3)
where col4='F'
and col2<=61.9;
Please help me resolve this. Thanks in Advance
It appears that the result goes into infinity . Is the formula correct? Do COL2 and COL3 look all right (I mean, do their values make sense in this context)?
The POWER (n2, n1) says (quoting Oracle doc.): POWER returns n2 raised to the n1 power. The base n2 and the exponent n1 can be any numbers, but if n2 is negative, then n1 must be an integer .
Therefore, as - in the first POWER function n1 is not an integer, then COL2 shouldn't be negative. Can you check COL2's sign?
As of COL3, it can be (virtually) any positive number (as that POWER returns 0 in that case), but it can't be much less than -1E4, so - check its range in the TABLE_NAME.

[Updated on: Tue, 27 December 2016 01:05]

Report message to a moderator

Thanks for the reply Littlefoot. There were some rows in col2 where the values were 0 and hence the error. Deleted the 0's and now the code is running.
Regards,
Challa
you should not store calculate values that can be gotten from the other columns. it is too easy to get out of sync if you change one of the columns used in the calculation. If your are running oracle 11 or above I would make the calculation as a virtual column containing the calculation and a constraint to stop col2 and col3 from being zero or null.

Current Time: Sun Nov 24 04:53:22 CST 2024