Bonjour,
Dans une de mes procédures je manipule des collections afin de faire des calculs sur des données. Ma procédure renvoie un ref cursor.
J'aimerai remplir mon ref cursor à partir d'une collection en faisant un cast comme ceci :
et j'ai l'erreur ora-00902 : Invalid datatype;
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 open plan_ret for select * from table(cast(plan_ as RP3.tab_planification_ref));
Sacahant que mon ref cursor et ma collection pointe sur le meme record..
Voici le code de mon packages :
La partie BODY :
La Partie specification :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 Procedure planification(anne in numeric ,plan_ret out plan_ref) --return planification_tab is plan_ tab_planification_ref; .................. open plan_ret for select * from table(cast(plan_ as RP3.tab_planification_ref)); end planification;
J'ai pas mal charchebsur internet mais je vois vraiment pas où est le problème.
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 CREATE OR REPLACE PACKAGE NQI.RP3 AS Type tab_planification_rec is record ( domaine_ EXTRA_PROJECT.domaine_code%type, code NQI_CPPJ_PROJECT.CODE%type, nom NQI_CPPJ_PROJECT.name%type, status NQI_CPPJ_PROJECT.STATUS%type, personel NQI_P_BUDGET_ITEM.DESCRIPTION%type, jour date, budget numeric ); ........ TYPE tab_planification_ref IS TABLE OF tab_planification_rec INDEX BY BINARY_INTEGER; Type plan_ref is ref cursor return tab_planification_rec; ....... Procedure planification(anne in numeric ,plan_ret out plan_ref); --tab_return planification_ref; END RP3; /
Pouvez vous donc m'aidez ????
Partager