Créer une collection avec les données d'une table
Bonjour, je voudrais dans un tableau à 2 dimensions mettre en valeur une de mes tables qui possède 2 colonnes.
j'ai essayé ceci :
Code:
1 2 3 4 5 6 7 8 9
| declare
TYPE alliage_table IS TABLE of varchar2(100) INDEX BY binary_integer ;
TYPE alliage_table_tab IS TABLE of int_qfs_alliage_ref INDEX BY binary_integer ;
tab alliage_table_tab;
Begin
DBMS_OUTPUT.PUT_LINE(tab(2)(2));
END; |
int_qfs_alliage_ref est la table de ma base.
le message d'erreur est :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| Rapport d'erreur :
ORA-06550: line 3, column 38:
PLS-00488: invalid variable declaration: object 'INT_QFS_ALLIAGE_REF' must be a type or subtype
ORA-06550: line 3, column 3:
PL/SQL: Item ignored
ORA-06550: line 9, column 24:
PLS-00224: object 'TAB' must be of type function or array to be used this way
ORA-06550: line 9, column 3:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action: |
par contre j'arrive à créer le tableau à 2 dimensions vide :
Code:
1 2 3 4
| declare
TYPE TYP_TAB IS TABLE of varchar2(100) INDEX BY binary_integer ;
TYPE TYP_TAB_TAB IS TABLE of TYP_TAB INDEX BY binary_integer ;
tab TYP_TAB_TAB ; |
ps : j'utilise sql developer 10g
Cordialement