If Statements Using Variable SQL
In this example I will be showing how to use If Statment Using Variable
DECLARE v_smith emp%ROWTYPE; v_blake emp%ROWTYPE; BEGIN SELECT * INTO v_smith FROM emp WHERE ename = 'SMITH'; SELECT * INTO v_blake FROM emp WHERE ename = 'BLAKE'; DBMS_OUTPUT.PUT_LINE(v_smith.sal||' '||v_blake.sal); IF v_smith.sal > v_blake.sal THEN DBMS_OUTPUT.PUT_LINE('Smith makes more money'); ELSE DBMS_OUTPUT.PUT_LINE('Blake makes more money'); END IF; END; /
Total Views: 648
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.