Bonjour,

J'aimerais inserer une donnée dans une autre table mais j'ai des erreurs de synthaxe, j'apprend à programmer en pl/sql aidez moi a corriger ces erreurs please
requete :


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 
DECLARE
   TYPE tabnumber_test IS VARRAY(20) OF number(30);
   tab tabnumber_test;
   --tab = tabnumber_test();   --initialise
 li_id number;
statictic2 number;
value2 tabnumber_test;
 
-- Déclaration du curseur
CURSOR C_EMP IS
Select sid, CON_ID, value From v$sesstat
where sid = 19;
 
ll_sid_previous number;
 
 dernierNombre INTEGER;
 
 
Begin
OPEN C_EMP;
LOOP
--FETCH C_EMP INTO li_id, statictic2, value2;                                  
EXIT WHEN C_EMP%NOTFOUND;
 
 
 
for ligne in delta_test.FIRST..delta_test.LAST  loop
	  select id from (select * from delta_test) where ROWNUM = ligne;
    DBMS_OUTPUT.PUT_LINE(ll_sid_previous);
 
	if ll_sid_previous <> null AND li_id = ll_sid_previous then
 
		   dernierNombre := tab.COUNT+1;
 
				if dernierNombre<=tab.LIMIT THEN
					tab(dernierNombre) :=  ' ; '|| value2;
					dbms_output.put_line( tab.ll_sid_previous|| ' ; '|| tab.value2);
 
				END IF;
 
  else            
              insert into delta_test (id, statistic, nombre)
              values (li_id, statictic2, value2);             
 
  END IF;
END LOOP;
END LOOP;
CLOSE C_EMP;
commit;
End;
 
/
Mes erreurs :

Error report -
ORA-06550: line 27, column 25:
PLS-00302: component 'FIRST' must be declared
ORA-06550: line 27, column 1:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action: