HELP NEEDED ABOUT USING TABLE IN PL/SQL

From: Guillaume LE MENER <glm_at_silicomp.com>
Date: Thu, 04 Feb 1999 21:42:25 +0100
Message-ID: <36BA0631.92840542_at_silicomp.com>



Hello,

It's the first time I'am using PL/SQL.

How it is possible to create dynamically new element in a PL/SQl table.

This my PL/SQL code extract from a package body but it doesn't not work 'cos the value of i 1 and the collection contains no data.

Is there a solution to add element to a table dynamically ?

Thank you in advance.



Exemple :

ListeServiceTyp is declared in the specication package.

FUNCTION getListeServiceFixe(

        fils_id service.service_id%TYPE) RETURN ListeServiceTyp IS

	aListe ListeServiceTyp ;
	serviceRow service%ROWTYPE ;
	i BINARY_INTEGER ;
		
	CURSOR serviceCursor IS
		SELECT *
		FROM service
		WHERE (type_service_id >=1 AND type_service_id <=3)
		START WITH service_id = fils_id
		CONNECT BY service_id = PRIOR ser_service_id ;
BEGIN
	-- Appel du constructeur de la liste
	aListe := ListeServiceTyp() ;
	IF fils_id IS NOT NULL THEN
	i := 1 ;
	FOR serviceRow IN serviceCursor LOOP
		IF serviceCursor%FOUND THEN
			aListe(i) := serviceRow ;
		i := i + 1 ;
		END IF ;
	END LOOP;	
	END IF ;
	RETURN aListe ;

END getListeServiceFixe ;
--
Received on Thu Feb 04 1999 - 21:42:25 CET

Original text of this message