Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
final
create table empl(emp_id int,emp_name varchar2(10),salary int, category varchar(10)); insert into empl("1","A","25000"); insert into empl("2","B","50000"); insert into empl("3","C","25000"); insert into empl("4","D","75000"); insert into empl("5","E","20000"); declare first exception; eid number:=:eid; inc int; begin inc:=0; select Salary into inc from empl where eid=emp_id; if (inc>75000) then raise first; elsif (inc<25000) then update empl set Category='Worker' where emp_id=eid; dbms_output.put_line('Salary Input Valid'); elsif (inc>=50000 and inc<=75000) then update empl set Category='Senior' where emp_id=eid; dbms_output.put_line('Salary Input Valid'); else update empl set Category='Junior' where emp_id=eid; dbms_output.put_line('Salary Input Valid'); end if; exception when first then dbms_output.put_line('error'); end;
run
|
edit
|
history
|
help
0
MIX
emp
Srinivas
BCOM
sss
neha
HELLO WORLD
test
Extract Year from Date Field Example
Cursor Explicit