jeudi 25 janvier 2018

Alternate to DECODE like function to be used in elsif statement in PLSQL procedure oracle

I am trying to use a condition els if where something like decode need to be used so that the condition is true and insertion is made. I am doing this in a sql procedure and condition is like

elsif((v_DIVIDEND/Divisor)-1 < ABS(0.2)) then insert into table(Divisor,b,c) values(Dividend,y,z)......it works fine when the divisor is not zero but when divisor is zero it gives error for the same. i want to rule out zero's in divisor using like another nested if condition within elsif or something like decode. i tried another if but syntax seemed to be wrong. Using Decode says it can only be used in sql statement. Any suggestions please...

Aucun commentaire:

Enregistrer un commentaire