@ -829,7 +829,7 @@ La condition est une combinaison d'expressions au moyen d'opérateurs :
\begin{exemple}Calcul de factorielle.
\begin{exemple}Calcul de factorielle.
\begin{verbatim}
\begin{verbatim}
CREATE TABLE tligne (ligne VARCHAR2(200));
CREATE TABLE Tligne (ligne VARCHAR2(200));
VARIABLE n NUMBER
VARIABLE n NUMBER
PROMPT taper n
PROMPT taper n
ACCEPT n
ACCEPT n
@ -845,12 +845,12 @@ BEGIN
fn := fn * i;
fn := fn * i;
END LOOP;
END LOOP;
INSERT INTO tligne
INSERT INTO Tligne
VALUES ( 'Factorielle de '|| TO_CHAR(n)||, ‘‘,TO_CHAR(fn));
VALUES ( 'Factorielle de '|| TO_CHAR(n)||, ‘‘,TO_CHAR(fn));
END;
END;
/
/
SELECT * FROM tligne;
SELECT * FROM Tligne;
DROP TABLE tligne;
DROP TABLEl Tligne;
\end{verbatim}
\end{verbatim}
\end{exemple}
\end{exemple}
@ -868,10 +868,10 @@ Les types d'erreurs sont les suivants :
\begin{exemple} Les résultats à afficher sont placés dans
\begin{exemple} Les résultats à afficher sont placés dans
une table \code{tligne}.
une table \code{Tligne}.
\begin{verbatim}
\begin{verbatim}
create table tligne ( ligne varchar2(150));
create table Tligne (Tligne varchar2(150));
variable vnoproduit char(4)
variable vnoproduit char(4)
prompt taper la référence du produit à rechercher:
prompt taper la référence du produit à rechercher:
accept vnoproduit
accept vnoproduit
@ -887,16 +887,16 @@ dnoproduit:= ‘&vnoproduit’;
dmessage := 'Référence inconnue ';
dmessage := 'Référence inconnue ';
select designation intoddesignation From tproduit where noproduit = dnoproduit;
select designation intoddesignation From tproduit where noproduit = dnoproduit;
insert into tligne values ('Désignation: ' || ddesignation);
insert into Tligne values ('Désignation: ' || ddesignation);
exception
exception
when no_data_found then
when no_data_found then
insert into tligne values ( dmessage);
insert into Tligne values ( dmessage);
end;
end;
.
.
/
/
select * from tligne;
select * from Tligne;
drop table tligne;
drop table Tligne;
\end{verbatim}
\end{verbatim}
\end{exemple}
\end{exemple}
@ -970,14 +970,14 @@ doit être la dernière erreur \\ && de la section \code{exception}.\\
\begin{exemple}[Détection de doublons sur une clé primaire.]
\begin{exemple}[Détection de doublons sur une clé primaire.]
La séquence suivante crée une ligne dans la table \code{tproduit (noproduit char(4) primary key, ...)} et stocke les erreurs dans une table \code{tligne (ligne varchar2(150));}
La séquence suivante crée une ligne dans la table \code{tproduit (noproduit char(4) primary key, ...)} et stocke les erreurs dans une table \code{Tligne (ligne varchar2(150));}
\begin{verbatim}
\begin{verbatim}
BEGIN
BEGIN
INSERT INTO tproduit VALUES (dnoproduit, ddesignation ...);
INSERT INTO tproduit VALUES (dnoproduit, ddesignation ...);
EXCEPTION
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
WHEN DUP_VAL_ON_INDEX THEN
INSERT INTO tligne VALUES (dnoproduit || 'déjà inséré');
INSERT INTO Tligne VALUES (dnoproduit || 'déjà inséré');