Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Error return by a function
Thanks Herald,
It works !
Best regards
Azhdin
Herald <aldam_at_capgemini.nl> a écrit dans le message :
378DE572.10773771_at_capgemini.nl...
> Hi,
>
> your two defined type are not the same for Oracle. So type ListeTesttyp
> is different from Tableau. In your SQL Worksheet you van define table1
> as pk_example.ListeTesttyp. This will work.
>
> Herald
>
> Azhdin wrote:
> >
> > Hi,
> >
> > I have a problem calling a function in a package PL/SQL which returns a
> > table
> >
> > My example is :
> > CREATE OR REPLACE PACKAGE PK_EXAMPLE AS
> > TYPE ListeTesttyp IS TABLE OF VARCHAR2(200) INDEX BY
BINARY_INTEGER;
> > TAB_Test ListeTesttyp;
> >
> > FUNCTION F_Search(pTexte IN VARCHAR2) RETURN ListeTesttyp;
> > END PK_EXAMPLE ;
> > /
> > CREATE OR REPLACE PACKAGE Body PK_EXAMPLE AS
> >
> > FUNCTION F_Search(pTexte IN VARCHAR2) RETURN ListeTesttyp is
> >
> > BEGIN
> >
> > TAB_Test.Delete;
> > TAB_Test(0) := 'Toto';
> > TAB_Test(1) := 'Titi';
> >
> > RETURN TAB_Test;
> > END F_Search;
> >
> > END PK_EXAMPLE ;
> >
> > When i want to calling the function in SQL Worksheet, like this :
> >
> > Declare
> > type tableau is TABLE OF VARCHAR2(200) INDEX BY BINARY_INTEGER;
> > table1 tableau;
> > begin
> > table1:=PK_EXAMPLE .f_search('my search');
> > end;
> >
> > It returns :
> > table1:=pk_searchtotem2.f_search('toto');
> > *
> > ORA-06550: line 5, column 9:
> > PLS-00382: expression is of wrong type
> > ORA-06550: line 5, column 1:
> > PL/SQL: Statement ignored
> >
> > But if the function is not in the package, it seems to work well....
> > Any idea ????
> >
> > Thanks
> >
> > Azhdin
> > Configuration : Oracle 7.3.4 on WinNT 4.0
> >
> > email : aboulahouat_at_algoba.com
Received on Thu Jul 15 1999 - 09:22:01 CDT
![]() |
![]() |