Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Error return by a function

Error return by a function

From: Azhdin <azhdin.boulahouat_at_libertysurf.fr>
Date: Thu, 15 Jul 1999 15:03:39 +0200
Message-ID: <7mkln8$19j$1@news2.isdnet.net>


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 - 08:03:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US