Précédent   Forum des professionnels en informatique > Bases de données > Oracle > PL/SQL
PL/SQL Forum d'entraide sur le PL/SQL
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 30/06/2011, 08h05   #1
Candidat au titre de Membre du Club
 
Femme
Inscription : mai 2011
Messages : 33
Détails du profil
Informations personnelles :
Sexe : Femme

Informations forums :
Inscription : mai 2011
Messages : 33
Points : 11
Points : 11
Par défaut 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
hidiho est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/06/2011, 09h40   #2
Expert Confirmé Sénior
 
Avatar de mnitu
 
Homme Marius Nitu
Ingénieur développement logiciels
Inscription : octobre 2007
Messages : 3 311
Détails du profil
Informations personnelles :
Nom : Homme Marius Nitu
Localisation : France, Marne (Champagne Ardenne)

Informations professionnelles :
Activité : Ingénieur développement logiciels
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : octobre 2007
Messages : 3 311
Points : 5 810
Points : 5 810
Citation:
Envoyé par hidiho Voir le message
...
int_qfs_alliage_ref est la table de ma base.
...
Exemple:
Code :
1
2
 
  Type emp_aa IS TABLE Of scott.emp%rowtype INDEX BY binary_integer;
mnitu est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 03h37.


 
 
 
 
Partenaires

Hébergement Web