You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
676 B
30 lines
676 B
SET echo OFF
|
|
SET verify OFF
|
|
SET feed OFF
|
|
|
|
DROP TABLE tligne;
|
|
CREATE TABLE Tligne(ligne VARCHAR2(200));
|
|
|
|
DECLARE
|
|
DnoProduit tProduit.noProduit%TYPE;
|
|
Ddesignation tProduit.designation%TYPE;
|
|
Dstock tProduit.stock%TYPE;
|
|
Dclassement NUMBER;
|
|
CURSOR r IS SELECT noProduit,designation,stock FROM tProduit ORDER BY stock;
|
|
|
|
BEGIN
|
|
Dclassement := 1;
|
|
INSERT INTO Tligne VALUES('noProduit designation stock classement');
|
|
OPEN r;
|
|
FETCH r INTO DnoProduit,Ddesignation,Dstock;
|
|
WHILE r%FOUND
|
|
LOOP
|
|
INSERT INTO Tligne VALUES(DnoProduit||' '||Ddesignation||' '||Dstock||' '||Dclassement);
|
|
Dclassement := Dclassement + 1;
|
|
FETCH r INTO DnoProduit,Ddesignation,Dstock;
|
|
END LOOP;
|
|
CLOSE r;
|
|
END;
|
|
.
|
|
/
|