Explicit Loop If Example SQL
In this example I will be showing Explicit Loop
DECLARE blake_sal emp.sal%TYPE; ward_sal emp.sal%TYPE; BEGIN FOR rec IN (SELECT * FROM emp) LOOP IF rec.ename = 'BLAKE' THEN blake_sal := rec.sal; ELSIF rec.ename = 'WARD' THEN ward_sal := rec.sal; END IF; END LOOP; IF blake_sal > ward_sal THEN DBMS_OUTPUT.PUT_LINE('Blake makes more'); ELSE DBMS_OUTPUT.PUT_LINE('Blake does not make more'); END IF; END; /
Total Views: 744
My name is Jean-Mathieu
I created this website so other people could enjoy finding useful stuff easier. If you have any question do not hesitate to contact me.
|jean8mathieu||Created on 02/25/15|
Disclosure: We are a website that needs compensation to operate like any other website on the internet.
We may receive consideration for our reviews but we are totally unbiased and do not accept paid reviews or fake reviews claiming to be something they are not.