declare
X number(10):=&P;
Y Varchar2(30);
begin
if X>2 then
Y:='Small';
end if;
dbms_output.put_line(Y);
end;
Declare
X number(10):=&P;
Y Varchar2(30);
begin
if X>2 then
Y:='SMall';
ELSif X>10 then
Y:='Medium';
ELSIF X>20 then
Y:='Large';
Else
Y:='Invalid';
end if;
dbms_output.put_line(Y);
end;
declare
X number(10);
Y Varchar2(30);
begin
Select ID,NAME into X,Y from XXX_test where ID=&ID;
Case
when X=10 and Y='Siddha' then
dbms_output.put_line('first record');
when X=20 and Y='reddy' then
dbms_output.put_line('Second record');
when X=30 and Y='Sunil' then
dbms_output.put_line('Third record');
Else
dbms_output.put_line('Invalid');
end Case;
end;
No comments:
Post a Comment