I have to use an array into my stored procedure. So I created a type variable:
CREATE OR REPLACE TYPE integer_array is table of number;
Then I tried to write my stored procedure, but I can't to compile it:
create or replace
PROCEDURE SP_TEST(
i_id_profiles in integer_array,
o_clients OUT SYS_REFCURSOR
)
AS
BEGIN
open o_clients for
FOR i IN 1..i_id_profiles.count LOOP
select a.id_client from b_client a, i_client_profile b where a.id_client = b.id_client
and b.id_profile = i_id_profiles(i);
END LOOP;
END SP_TEST;
Can you help me? I want to get a SYS_REFCURSOR of my select.
thanks
The error:
PLS-00103: Encountered the symbol "FOR" when expecting one of the following: ( - + case mod new not null select with
continue avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipePLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: end not pragma final instantiable order overriding static member constructor map