J'ai déclaré les types suivants dans mon package PL / SQL:
PLS-00306: wrong number or types of arguments in call to 'EXTEND'
4 Réponses :
Vous ne pouvez pas étendre un tableau associatif.
Il suffit d'assigner des valeurs
Vous n'allez pas une table indexée par "quelque chose", vous pouvez simplement l'utiliser ...
DECLARE TYPE t_simple_object IS RECORD ( wert NUMBER , gs NUMBER , vl NUMBER ); TYPE t_obj_table IS TABLE OF t_simple_object; my_rec t_simple_object; obj t_obj_table := t_obj_table(); BEGIN obj.EXTEND; my_rec.wert := 1; my_rec.gs := 1; my_rec.vl := 1; obj(1) := my_rec; END; /
Si vous ne voulez pas utiliser une matrice associative (AKA Index-by Table), laissez la clause «Index de Binary_Integer». Votre code fonctionne alors OK:
declare TYPE t_simple_object IS RECORD ( wert NUMBER, gs NUMBER, vl NUMBER); TYPE t_obj_table IS TABLE OF t_simple_object; obj t_obj_table; begin obj := t_obj_table (); obj.EXTEND(); end;
ou simplement utiliser un enregistrement (ou un tableau associé d'enregistrements)