1 Reply Latest reply on Jul 25, 2013 6:03 AM by 83077ba3-1e10-4d81-b496-bda8205c55aa

    PLS-00311 Error

    276228
      Hi,

      who can help? What's wrong here?

      I have a JSP called class A:

      public class A     {

           public static String hurz;
           public static String furz;     
           
           public A()     {

           }
           public A(String s,String w)     {
                this.hurz = s;
                this.furz = w;
           }

           public static void main (String[] args)     {
                A a = new A(args[0],args[1]);
                System.out.println(hurz);
                System.out.println(furz);          
                a.doSomething(hurz,furz);     
                System.out.println("Ergebnis: " + hurz + " " + furz);                    
           }
           
           public static void doSomething(String eins, String zwei)     {
                hurz += zwei;
           }
           
           public static String hallo(String name)     {
                return "Hallo " + name + "!";
           }
      }


      After loading it into the Database (loadjava....) I wrote a Package called test_manager.


      CREATE OR REPLACE PACKAGE test_manager AS

           PROCEDURE test_main(eins IN OUT VARCHAR2,
                     zwei IN VARCHAR2);     
                                                                            FUNCTION test_hallo(f_name IN VARCHAR2) RETURN VARCHAR2;
           
      END test_manager;                                                       
      /

      CREATE OR REPLACE PACKAGE BODY test_manager AS

           PROCEDURE test_main(eins IN OUT VARCHAR2,zwei IN VARCHAR2)
                AS LANGUAGE JAVA
                NAME 'A.main(java.lang.String[],java.lang.String)';
                                         
           FUNCTION test_hallo(f_name IN VARCHAR2)
                RETURN VARCHAR2
                AS LANGUAGE JAVA          
                NAME 'A.hallo(java.lang.String) RETURN java.lang.String';
                
      END test_manager;          
      /


      When I try to load the Package into the DB, I get compilation errors I don't understand!?



      SQL> @ test_manager

      Package created.


      Warning: Package Body created with compilation errors.

      SQL> show errors
      Errors for PACKAGE BODY TEST_MANAGER:

      LINE/COL ERROR
      -------- -----------------------------------------------------------------
      2/1 PL/SQL: Item ignored
      4/2 PLS-00311: the declaration of
      "A.main(java.lang.String[],java.lang.String)" is incomplete or
      malformed

      6/1 PL/SQL: Item ignored
      9/2 PLS-00311: the declaration of "A.hallo(java.lang.String) RETURN
      java.lang.String" is incomplete or malformed

      SQL>


      Anybody can help?

      Thanks
      Bernd