|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Coding Help
I have an arithmatic expression which is dynamic say
expression = [Col5]/[Col1] i will be using this in building a dynamic SQL.so i have to make sure that the divisible by zero is taken care. In the expression Col1,Col5 are values coming from a SQL. For the above expression, my conversion will be ROUND( ((CCol4 / DECODE (CCol1, 0, NULL, CCol1) )), 0). I have to build a function which takes in the expression and fetches me the result.My expression can be any combination of arithmaticexpression involving columns. Ex: [Col4 + Col2]/[Col3-Col1]*[Col5]. Does anyone have an idea how to do it or any similar code that they have that can give an idea as to how to approach it. Thanks, Kiran |
|
#2
|
|||
|
|||
|
I don't see how you can do this unless you define in advance what dynamic calculations you will allow.
The validity of any column value is going to depend upon its ultimate meaning in the expression. A zero in an addition may be fine. A zero in a numerator may be arithmetically fine but logical nonsense. A zero in a divisor will be an arithmetic killer; but may have a logical significance. Then there are NULLs to consider... |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Coding Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|