0% found this document useful (0 votes)
10 views2 pages

PLSQL

Uploaded by

icomlab.tn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

PLSQL

Uploaded by

icomlab.tn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Examen TP

Exercice n° 1 :

Declare

N number ;
i number;

Begin
DBMS_OUTPUT.PUT_LINE('saisir une valeur ');
N :=:N ;

FOR i IN 1..N LOOP


IF MOD(n, i) = 0 AND MOD(i, 2) <> 0 THEN
DBMS_OUTPUT.PUT_LINE(i);

end if ;
end loop ;

end;

Exercice n° 2 :

Declare

N number;
X number;
Reslt Number ;

Begin

DBMS_OUTPUT.PUT_LINE('saisir une valeur X : ');


X :=:X ;
DBMS_OUTPUT.PUT_LINE('saisir une valeur N : ');
N :=:N ;
Reslt:= POWER(X,N);
DBMS_OUTPUT.PUT_LINE( Reslt );
end;
Exercice n° 3 :

create table temp.tp1

n1 number ;
n1 number ;
message varchar(20);

insert into temp.tp1 (m ,n2) values (20,10);


insert into temp.tp1 (n1 ,n2) values (50,80);

declare
n temp.tp1.n1 % type ;
m temp.tp1.n2 % type ;
msg

select n1,n2 into n,m from temp.tp1


if n >= m then
msg := ' nb1 est plus grand que nb2’ ;

else
msg := ' nb2 est plus grand que nb1’ ;
endif ;

update temp.tp1 set message=msg ;


end ;

You might also like