Performance problem with java stored procedure

hi,
i developped a java class, then I stored it in Oracle 8.1.7.
This class contains several import of other classes stored in the database.
It works, but the execution perfomances are disappointing. It's very long. I guess, that's because of the great number of classes to load that are necessary for my class execution.
I tried to increase the size of the java pool (I parameter 70 Mo in the java_pool_size parameter of the init.ora), but the performance is not much better.
Has anyone an idea to increase the performance of this execution of my class ?
In particular, is there a way to keep permanently in memory the java objects used by my class ?
Thanks in advance
bye
[email protected]
null

before running Java, the database session needs to be Java enabled; this might be the reason why it is taking so long. If this is the case, you should see an improvement in subsequent calls, once a database session is Java enabled, other users can benefit from it.
Kuassi
I have some performance issue with java stored procedure. Hope some one will be able to help me out. I'm using java stored procedures in my application and basically these procedures are used to do some validation and form the XML message of the database tables. I have noticed that when I call the PL/SQL wrapper function, it is taking time to load the java class and once the class is loaded the execution is faster. Most of the time is spent for loading the class rather than executing the function. if I reduce the class load time, I can improve the performance drastically. Do any one of you know how to reduce the class load time. The following are the platform and oracle version.
O/S: IBM AIX
Oracle: 8.1.7

Similar Messages

  • Problems with java stored procedure.

    I have a java stored procedure that uses a package called RmiJdbc
    which allows calling remote JDBC data sources from any java capable
    machine.
    I've loaded the RmiJdbc classes into oracle via the loadjava
    command and everything seems to come up valid.
    The stored procedure does a Class.forName() to get the driver
    registered, than attempts to connect to the remote RMI driver.
    The particular line it dies on is this (see the error below):
    c = DriverManager.getConnection("jdbc:rmi:" + rmiHost + "/" + url);
    A mangled version of this (minus the Oracle specific stuff) works
    from the command line correctly. Can somebody point me in a
    direction to figure out what's going on here?
    THanks,
    Eric
    Oracle9i Enterprise Edition Release 9.0.1.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.0.1.3.0 - Production
    ORACLE_HOME = /oracle/v901ee
    System name: HP-UX
    Node name: athena
    Release: B.11.00
    Version: A
    Machine: 9000/889
    Instance name: PASDB2
    Redo thread mounted by this instance: 1
    Oracle process number: 13
    Unix process pid: 7839, image: oracle@athena (TNS V1-V3)
    *** SESSION ID:(8.547) 2002-08-15 15:41:27.221
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at sun.rmi.server.LoaderHandler$LoaderKey.<init>(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.lookupLoader(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java)
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputArray(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java)
    at sun.rmi.registry.RegistryImpl_Stub.lookup
    at org.objectweb.rmijdbc.RJConnection.<init>(RJConnection:83)
    at org.objectweb.rmijdbc.Driver.connect(Driver:135)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at TurnoverInfoPlusInterface.insertInterfaceRecords(TurnoverInfoPlusInterface:53)
    java.sql.SQLException: Error unmarshaling return; nested exception is:
    java.lang.NullPointerException
    at org.objectweb.rmijdbc.Driver.connect(Driver:140)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at TurnoverInfoPlusInterface.insertInterfaceRecords(TurnoverInfoPlusInterface:53)

    More info...I'm also seeing "ORA-03113: end-of-file on communication channel". I checked the user trace file and didn't get much help...it indicated an "exception signal: 11" and core-dump type stuff that had no meaning to me.

  • Perfomance problem with java stored procedure

    hi,
    i developped a java class, then I stored it in Oracle 8.1.7.
    This class contains several import of other classes stored in the database.
    It works, but the execution perfomances are disappointing. It's very long. I guess, that's because of the great number of classes to load that are necessary for my class execution.
    I tried to increase the size of the java pool (I parameter 70 Mo in the java_pool_size parameter of the init.ora), but the performance is not much better.
    Has anyone an idea to increase the performance of this execution of my class ?
    In particular, is there a way to keep permanently in memory the java objects used by my class ?
    Thanks in advance
    bye
    [email protected]
    null

    Hello again,
    I read the documentation of 9i and found some hints about different TCP/IP socket handling of 9i and a standard JVM.
    There are some parts that give hints but I couldn't find a sample code to show how to handle the differences.
    Could anyone tell me how to handle the differences or give some links to sample code?
    Thanks
    Detlev

  • What is the problem with this Stored Procedure

    Hi ,
    What is the problem with this Stored Procedure ?Why is it giving errors ??
    CREATE or replace  PROCEDURE getEmpName
    *(EMP_FIRST OUT VARCHAR2(255))*
    BEGIN
    SELECT ename INTO EMP_FIRST
    FROM Emp
    WHERE EMPNO = 7369;
    END ;
    */*

    You don't specify precision in procedure arguments.
    (EMP_FIRST OUT VARCHAR2(255))should be
    (EMP_FIRST OUT VARCHAR2)Since you asked what's wrong with it, I could add that it needs formatting and the inconsistent use of upper and lower case is not helping readability.

  • Problem of java stored procedure

    hi,
    now I use the oracle9i JDeveloper9.0.3.1 to develop java stored procedure and then publish it to oracle9i database.
    In the database I create PL/SQL procedure to invoke the java stored procedure.But I encounter the problem,that is ,when I run the PL/SQL procedure ,it throw the java.lang.NullPointerException ,while the java class,the java stored procedure can run correctly invoked by the main class of java.The code of the java stored procedure is as follows:
    import java.sql.*;
    import java.util.Properties;
    public class SQLServerEventDistribute
    public static void sqlServerSaveData(String hostName,String databaseName,String user,String password,String tableName,int x1,int y1,int x2,int y2,String ip)
    String url="",sql="",userName="",passwd="";
    Connection connection;
    Statement statement;
    url="jdbc:microsoft:sqlserver://"+hostName+":1433;DatabaseName="+databaseName+";User="+user+";Password="+password;
    sql="INSERT INTO "+tableName+" VALUES("+x1+","+y1+","+x2+","+y2+",'"+ip+"')";
    Properties property=new Properties();
    property.setProperty(userName,user);
    property.setProperty(passwd,password);
    try
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    connection=DriverManager.getConnection(url,property);
    statement=connection.createStatement();
    statement.execute(sql);
    }catch(ClassNotFoundException connectSQLServerEx)
    System.out.println(connectSQLServerEx.getMessage());
    catch(SQLException connectSQLServerEx)
    System.out.println(connectSQLServerEx.getMessage()+connectSQLServerEx.getErrorCode());
    the main class is as follows:
    public class Test
    public static void main(String[] args)
    SQLServerEventDistribute.sqlServerSaveData("gsm","gsmd","sa","sa","IPBinding",11,45,24,21,"23.1.248.12");
    and the PL/SQL procedure is as follows:
    PROCEDURE TEST AS
    BEGIN
    SQLSERVERSAVEDATA('gsm','gsmd','sa','sa','IPBinding',11,45,24,21,'23.1.248.22');
    END;
    How can I deal with it?
    can you tell me?
    thanks

    Hi JavaQQ,
    This is just a guess, but I think you need to load the
    Micro$oft SQLServer JDBC driver into the Oracle
    database (using the "loadjava" utility).
    In any case, there are several ways -- apart from JDBC
    -- for accessing a different database from within an
    Oracle database. Have you tried searching the Oracle
    Web sites for suitable products?
    Hope this helps.
    Good Luck,
    Avi.abramia ,thank you very much.
    but I have load the Microsoft SQLServer JDBC driver into the Oracle database .
    When I debugged the PL/SQL procedure,the exception was thrown at line connection=DriverManager.getConnection(url,property);
    What's the problem with it?

  • APEX fails with Java stored procedure that creates a JDBC connection

    Hello!
    We are facing a strange problem since we have upgraded from Oracle 10g and Apache to Oracle 11g with Embedded Gateway.
    Here is what we do:
    ** APEXX calls a PL/SQL package function "OPEN_CONNECTION" that wraps a Java stored procedure called "openConnection".*
    FILE_READER_REMOTE_API.openConnection(user, password, host, port, service);
    ** The Java stored procedures "openConnection" opens a JDBC connection to an other database:*
    public class FileReaderRemote {
    private static Connection conn = null;
    private static DefaultContext remoteContext = null;
    public static void openConnection(String user, String password, String host, String port, String service) throws SQLException {
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    java.util.Properties props = new java.util.Properties();
    props.put ("user", user);
    props.put ("password", password);
    //props.put ("database", "//" + host + ":" + port + "/" + service);
    props.put ("database", host + ":" + port + ":" + service);
    props.put("v$session.program", "FileReaderRemote2");
    // Connect to the database
    remoteContext = Oracle.getConnection("jdbc:oracle:thin:", props);
    This procedure used to work fine before the upgrade, but now we see the following:
    * It still works when called directly from TOAD or SQL*Plus, even under the user ANONYMOUS.
    * When called from APEX and the target database is Oracle 11g, it still works.
    * When called from APEX and the target database is Oracle 10g, it takes several minutes and we receive this error:
    *"Socket read timed out"*
    We have tested the following workaround:
    We have created a database link to our own database and called the stored procedure through that database link.
    FILE_READER_REMOTE_API.openConnection*@loopback*(user, password, host, port, service);
    This works, but is not really an option.
    I hope some one of you can explain this strange behaviour to me.
    Best regards,
    Matthias

    You wrote
    "Java stored procedures -- by definition - are stored in the 8i rdbms. !!"
    From the Oracle8i Java Stored Procedures Developer's Guide
    Release 8.1.5
    A64686-01
    "If you create Java class files on the client side, you can use loadjava to upload them into the RDBMS. Alternatively, you can upload Java source files and let the Aurora JVM compile them. In most cases, it is best to compile and debug programs on the client side, then upload the class files for final testing within the RDBMS"
    This means that you can create shared classes that are used on both the client and server side. The source does not need to reside within the server (according to their documentation). Please also note the following from the Oracle8i JDBC Developer's Guide and Reference Release 8.1.5 A64685-01 for using the getConnection() method on the server:
    "If you connect to the database with the DriverManager.getConnection() method, then use the connect string jdbc:oracle:kprb:. For example:
    DriverManager.getConnection("jdbc:oracle:kprb:");
    Note that you could include a user name and password in the string, but because you are connecting from the server, they would be ignored."
    So if you're coding a shared class that is to run on both the client and server side, you might do something like this:
    Connection conn =
    DriverManager.getConnection(
    System.getProperty("oracle.server.version") == null
    ? "jdbc:oracle:thin:@hostname:1521:ORCL"
    : "jdbc:oracle:kprb:"),
    "youruserid","yourpassword");
    As stated earlier, the userid and password are supposedly ignored for server connections retrieved in this manner. I haven't tried this yet, but it is documented by Oracle.
    Regards,
    Steve
    null

  • Deploy package with Java Stored Procedure without JDeveloper

    I have a set of Java Stored Procedures deployed as a package on a Oracle 8i server. Everything works fine in my development environment, and now I would like to deploy the same package in the customers runtime environment. Both environments are running Oracle 8i rel 2 on NT.
    Is there a simple way to use the JDeveloper .prf deployment profile without installing JDeveloper in the customers environment?
    If not, can I the get the .jar files and .sql scripts from JDeveloper to create the call specs and package bodys?
    I guess JDeveloper must have this information, and my idea was then to write a script using loadjava and SQL*Plus.
    Regards,
    Tom Bjerre

    you would not be able to take just the deployment profile and run it outside JDeveloper.
    You would be able to create archive of all java classes in the package using Deployment Wizard in JDeveloper.
    Then you can load the jar file using the utilities in 8i.
    JDeveloper does generate the SQL for CALL specs etc ., at the deployment time and it is printed in MEssage Viewer along with other information.
    Hope that info is useful for you
    raghu

  • Start with java stored procedure in SQLDeveloper

    Hi,
    i'm a newbe in writing PL/SQL stored procedures. Thats the reason to wont to write some java stored procedures for an ORACLE 10g. I'm using the SQLDeveloper. My Problem is: how can i start to write java stored procedures. Where have i to put them?
    Can somebody help me?
    10x
    cu nanostruct

    For Java Stored procedures you'll need to use JDeveloper. For SQL Developer, there is a viewlet and a tutorial on this page:
    http://www.oracle.com/technology/products/database/sql_developer/index.html
    Sue

  • Invoking Unix command with java stored procedure

    Hi,
    I have a perfectly working environment and now I am trying to replicate the same in another server. I have a java stored procedure which invokes the Unix command using java Runtime.exec() in my code named "run". I am sure that the code is called and the java class run is resolved in oracle as I could see that in dba_java_resolvers dictionary. But I am not sure whether the function in java is called or whether a exception is thrown. how to identify this? Could there be any thing to do with settings in oracle side? please help me.
    Thanks in advance,
    Marutha

    Hi,
    Do you get any output while running the code?
    I'm testing similar solution and if there are any errors or Oracle can't execute the program due to permissions or other issues the error information will be displayed. Also in the Java class itself you need to catch exceptions and print stack trace to standard output.
    declare
    x number;
    begin
    dbms_output.enable(1000000);
    dbms_java.set_output(1000000);
    x:=system_command.run_command('testconnect.sh');
    dbms_output.put_line('Returned value='||x);
    exception
    when others then dbms_output.put_line('Sql error='||substr(sqlerrm,1,250));
    end;
    <system_command.run_command> - replace with a call to your java stored procedure.

  • Performance issue on Java Stored Procedure

    I have converted the Stored Procedures into JSP with SQLJ. I
    loaded the classes (not the source) onto Oracle 8i Database and
    published within tbe stored packages. What I found out was the
    performance is about 12 times on average slower than the PL/SQL
    stored packages when I made calls to JSP. I am not surprise JSP
    is slower than PL/SQL but can we improve by tunning the Java
    codings or VM within the 8i database?
    null

    James Chan (guest) wrote:
    : I have converted the Stored Procedures into JSP with SQLJ. I
    : loaded the classes (not the source) onto Oracle 8i Database and
    : published within tbe stored packages. What I found out was the
    : performance is about 12 times on average slower than the PL/SQL
    : stored packages when I made calls to JSP. I am not surprise JSP
    : is slower than PL/SQL but can we improve by tunning the Java
    : codings or VM within the 8i database?
    all user written java code in the 8i rdbms is currently running
    as bytecode in the jvm.
    a future release will provide a component called "Native Compiler
    [NCOMP]" so it should run considerably faster then.
    see the following link for details :
    http://technet.oracle.com/files/search/search.htm?ncomp
    null

  • Problem with JDBC stored procedure

    Hi...
    We are implementing an interface from SAP r/3 4.7 to Oracle DB 9.0. On sender side we have used IDOC Adapter and on Receiver side we have used JDBC Adapter.
    Here we are using stored procedures in JDBC Adapter. I have 2 stored procedures(one for header and one for items) and SISCSO.SISCSO01 IDOC.
    Here we are getting following error in RWB for JDBC Receiver adapter....
    <b>Error</b>
    " Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
    Configured at 2006-08-16 10:12:14 GMT+05:30
    History:
    - 2006-08-16 11:02:04 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PR_SPARES_VOR_PO_HDR_UPLOAD' (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00201: identifier 'PR_SPARES_VOR_PO_HDR_UPLOAD' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored ".
    <b>My mapping file is like this.....</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:TVS_MST_SPARES_ORDER xmlns:ns0="urn:tvsmotor:salesorder"><statement><PR_SPARES_VOR_PO_HDR_UPLOAD action="execute"><table>PR_SPARES_VOR_PO_HDR_UPLOAD</table><IN_DEALER_ID isInput="true" type="String">efde</IN_DEALER_ID><IN_SPARE_PO_NO isInput="TRUE" type="STRING">sdfsdf</IN_SPARE_PO_NO><IN_PO_DATE isInput="TRUE" type="STRING">12.12.2555</IN_PO_DATE><IN_ORDER_TYPE isInput="TRUE" type="STRING">23</IN_ORDER_TYPE><IN_REMARKS isInput="TRUE" type="STRING">Remark</IN_REMARKS><IN_SAP_SALE_ORD_NO isInput="TRUE" type="STRING">146546</IN_SAP_SALE_ORD_NO><IN_SAP_SALE_ORD_DT isInput="TRUE" type="STRING">12.12.2555</IN_SAP_SALE_ORD_DT><IN_TOT_VAL isInput="TRUE" type="STRING">2323</IN_TOT_VAL></PR_SPARES_VOR_PO_HDR_UPLOAD><PR_SPARES_VOR_PO_DTL_UPLOAD action="execute"><IN_DEALER_ID isInput="TRUE" type="STRING">efde</IN_DEALER_ID><IN_SPARE_PO_NO isInput="TRUE" type="STRING">sdfsdf</IN_SPARE_PO_NO><IN_PO_DATE isInput="TRUE" type="STRING">12.12.2555</IN_PO_DATE><IN_PART_NO isInput="TRUE" type="STRING">cfgdfw4w</IN_PART_NO><IN_ORDER_QTY isInput="TRUE" type="STRING">2</IN_ORDER_QTY><IN_PENDING_QTY isInput="TRUE" type="STRING">20</IN_PENDING_QTY><IN_RATE isInput="TRUE" type="STRING">2432</IN_RATE><IN_TAX isInput="TRUE" type="STRING">18</IN_TAX></PR_SPARES_VOR_PO_DTL_UPLOAD></statement></ns0:TVS_MST_SPARES_ORDER>
    Please help me out with this error... tell me if more information is required.
    Thanks,
    Audumbar.

    hi mario,
    tell me one thing.... does case metter for stored procedure name? and even for the parameters used in stored procedure?
    i have changed the case of stored procedure name... (its small in Oracle) but have not changed the case of parameters....
    after changing the case also i m getting the following error....
    " Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
    Configured at 2006-08-16 10:12:14 GMT+05:30
    History:
    - 2006-08-16 14:18:19 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. <b>'pr_spares_vor_po_hdr_upload'</b> (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00201: identifier <b>'PR_SPARES_VOR_PO_HDR_UPLOAD'</b> must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored "
    Reply me as soon as possible.
    Thanx,
    Regards,
    Audumbar
    Message was edited by: Audumbar Pikle

  • Problem with java source procedure

    Hello everyone, I've set up a simple example that is supposed to create an fdf file on the server. I tested my program and it works fine.
    Now I'm trying to do the same thing except that I would like to have my java code in the database. Here's what I've done:
    # on database in opus schema
    create or replace and compile java source named testpdf as
    import java.io.*;
    import com.adobe.fdf.*;
    import com.adobe.fdf.exceptions.*;
    public class TestPDF
         public static void Test()
    try
         FDFDoc outputFDF = new FDFDoc();
         outputFDF.SetValue("status", "En traitement!");
         outputFDF.SetValue("Date", "01-01-2006");
         outputFDF.SetValue("Name", "Alexandre Folgueras");
         outputFDF.SetValue("Address", "12 Saratoga Ave");
         outputFDF.SetValue("City", "Saratoga");
         outputFDF.SetValue("State", "CA");
    outputFDF.SetFile("/tmp/java_pdf/GenerateFDF.pdf");
    outputFDF.Save("/tmp/java_pdf/alex.fdf");
    catch (Exception e)
    e.printStackTrace();
    create or replace procedure pdf_doc
    AS LANGUAGE JAVA
    NAME 'TestPDF.Test()';
    commit;
    Everything seems to be OK by when I run it, my file does not get created even though I don't get any errors.
    Anybody knows why?
    Thanks in advance!

    Hello,
    I'm also creating a class with static functions and putting it as a Java source in Oracle but I have problems with imports. In my case, I use MQSeries JAR files and when I put my code in Oracle, I have warnings "Java created with compilation errors". It's just about the lines where I create/use MQSeries objects, because when I comment them, I have no more errors.
    I see you also use specific imports with PDF, so I would like to know where you put the JAR files so that the Java source can be compiled correctly.
    Thanks in advance,

  • Problem with a stored procedure to search in a table

    h5.
    Hi,
    h5.
    As many people on the forum, I'm new on PL/SQL programming.
    h5.
    I'm trying to program a stored procedure that allow to search on my table fields with different parameters.
    h5.
    All this parameters doesn't need to be set, at least one.
    h5.
    I'm looking for the solution from 2 weeks ago.
    h5.
    I have looked everywhere
    h5.
    Could someone help me, please??
    h5.
    Here is my code:
    * HERE WE CREATE PACKAGE FOR THE CURSOR
    create or replace
    PACKAGE HOTEL_DEST_PKG
    IS
    /* Define the REF CURSOR type. */
    TYPE HOTEL_DEST_TYPE IS REF CURSOR;
    END HOTEL_DEST_PKG;
    * HERE WE CREATE OUR STORE PROCEDURE TO SEARCH
    create or replace
    PROCEDURE Search_Hotel (
    IdDocument IN number,
    MyFilter IN VARCHAR2,
    IdCountry IN number,
    DepartureDateFirst IN DATE,
    DepartureDateSecond IN DATE,
    HD_Cursor OUT HOTEL_DEST_PKG.HOTEL_DEST_TYPE)
    IS
    SQL_REQ VARCHAR2(5000);
    BEGIN
    /* all columns were entered */
    IF ((IdDocument > 0) OR
    ((MyFilter IS NOT NULL) AND (length(MyFilter) > 0)) OR
    (IdCountry > 0) OR
    (DepartureDateFirst IS NOT NULL) OR
    (DepartureDateSecond IS NOT NULL))
    THEN
    SQL_REQ := 'SELECT HOTEL_DESTINATION.*
    FROM HOTEL_DESTINATION
    WHERE 1=1';
    /* Search on the hotel id*/
    IF IdDocument > 0 THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_ID = :IdDocument';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :IdDocument IS NULL';
    END IF;
         /*Search on different indexed fields*/
    IF MyFilter IS NOT NULL AND LENGTH(MyFilter)>0 THEN
    SQL_REQ := SQL_REQ || ' AND CONTAINS(HOTEL_DESTINATION.HD_FILTER, :MyFilter)';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :MyFilter IS NULL';
    END IF;
    /* Search on the hotel country id*/
    IF IdCountry > 0 THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_CN_ID = :IdCountry';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :IdCountry IS NULL';
    END IF;
    /* Search on the dates*/
    IF DepartureDateFirst IS NOT NULL THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_DEPARTURE_DATE >= :DepartureDateFirst';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :DepartureDateFirst IS NULL' ;
    END IF;
    IF DepartureDateSecond IS NOT NULL THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_DEPARTURE_DATE <= :DepartureDateSecond';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :DepartureDateSecond IS NULL';
    END IF;
    OPEN HD_CURSOR FOR SQL_REQ USING IdDocument,
    MyFilter,
    IdCountry,
    DepartureDateFirst,
    DepartureDateSecond;
    END IF;
    END;
    * HERE WE CALL AND EXECUTE OUR STORE PROCEDURE TO SEARCH
    * ON WORD
    set serveroutput on
    DECLARE
         IDDOCUMENT NUMBER;
         MYFILTER VARCHAR2(200);
         IDCOUNTRY NUMBER;
         DEPARTUREDATEFIRST IN DATE;
         DEPARTUREDATESECOND IN DATE;
         HD_CURSOR OUT HOTEL_DEST_PKG.HOTEL_DEST_TYPE);
    BEGIN
    IDDOCUMENT := 0;
    MYFILTER := 'test';
    IDCOUNTRY := 0;
    DEPARTUREDATEFIRST := NULL;
    DEPARTUREDATESECOND := NULL;
    SEARCH_HOTEL(
    IDDOCUMENT => IDDOCUMENT,
    MYFILTER => MYFILTER,
    IDCOUNTRY => IDCOUNTRY,
    DEPARTUREDATEFIRST => DEPARTUREDATEFIRST,
    DEPARTUREDATESECOND => DEPARTUREDATESECOND,
    HD_Cursor => HD_Cursor
    -- Modify the code to output the variable
    --DBMS_OUTPUT.PUT_LINE('HD_Cursor = ' || HD_Cursor);
    END;

    You need to grant right on the table to the owner of the stored procedure directly (not via Role).
    When there are only rights via role everything is fine in sql, but it will not work in stored procedures, functions or packages.
    So as Table-Owner do:
    grant select on <table> to <procedure, package or function-owner>;Edited by: hm on 22.10.2010 08:49

  • Problem with java stored procs.

    Is there a restriction on accessing XML documents from Java stored procs?
    I have a Java program to parse XML document and return a string. If I run this program as a stand alone, the program runs fine.
    I loaded the oracle xmlparser.jar into ORACLE8i db sucessfully (used -resolve option). Then I loaded my .class file with -verbose and -resolve option and I did not get any erros. I created function which return string. When I ran the function, I did not get any value bacmk.
    Can I use System.out.println in java programs in ORACLE8i. If I can where can I see the output when the program runs? I not waht other mehtods I can use to debug the program running in ORACLE8i JVM.
    Thank You

    Hello again,
    I read the documentation of 9i and found some hints about different TCP/IP socket handling of 9i and a standard JVM.
    There are some parts that give hints but I couldn't find a sample code to show how to handle the differences.
    Could anyone tell me how to handle the differences or give some links to sample code?
    Thanks
    Detlev

  • Problem with a stored procedure (Error(4,1): PLS-00428: an INTO clause..)

    Dear Oracle Experts,
    I try to use the stored procedure below but get this error :
    "Error(4,1): PLS-00428: an INTO clause is expected in this SELECT statement"
    I don't have any clue what could be wrong with my syntax. INTO wouldn't make any sense at this task.
    Does someone of you know what's wrong with my Procedure ?
    Hope someone can help,
    best regards,
    Daniel Wetzler
    create or replace PROCEDURE AnalysisCompatibility (DATEBEGIN timestamp, DATEEND timestamp)
    AS
    BEGIN
    select Fs.*,Vs.Analysispriority,Vs.Compatibility Compatibility from SigFacts Fs
    inner Join Variables Vs On
    (Fs.Var_Ref=Vs.Var_Ref and Fs.Machines_Ref=Vs.Machines_Ref )
    where Fs.DT between DATEBEGIN and DATEEND
    and
    Vs.AnalysisPriority > 0
    or
    VS.Compatibility in (6,7,8,9,10,11,13,21,22)
    order by Fs.DT,Fs.Machines_Ref desc, Vs.AnalysisPriority;
    END AnalysisCompatibility;

    I have created a table (ATREPORT.TEST) that has has got the same column name and type of the query output and i still get error message
    PLS-00403 -- statement ATreport.TESt cannot be used as an into target, pls help
    DECLARE start_date DATE := to_date('01/09/2006' , 'DD-MON-YYYY');
    end_date DATE := to_date('30/09/2006' , 'DD-MON-YYYY');
    BEGIN
    SELECT t.SEC_SHORT_NAME, t.SEC_ISIN, t.SEC_NO,t.SEC_NAME, t.TRADE_DATE,
    t.PAYMENT_DATE,t.COUNTERPARTY, t.PRICE , t.NOMINAL ,
                        t.TRANSACTION_NO,t.CURRENT_VALUE_PC, t.CURRENT_VALUE_SC, t.PAYMENT_AMOUNT_PC,
                        t.PAYMENT_AMOUNT_SC,
                   ct.AMOUNT , ct.CURRENCY,
              sb.BUSINESS_CLASS_LEVEL_2 ,sb.BUSINESS_CLASS_LEVEL_2_NAME,
              sb.BUSINESS_CLASS_LEVEL_3 ,sb.BUSINESS_CLASS_LEVEL_3_NAME,
              sb.BUSINESS_CLASS_LEVEL_4 ,sb.BUSINESS_CLASS_LEVEL_4_NAME,
    sb.BUSINESS_CLASS_LEVEL_5 ,sb.BUSINESS_CLASS_LEVEL_5_NAME
    INTO ATREPORT.TEST
    from scdat.A_TRANSACTIONS t
    INNER JOIN scdat.A_COSTTAX ct     
         ON ct.TRANS_REF = t.TRANS_REF
    INNER JOIN scdat.A_SECS_BUSINESS_CLASS_TS sb
    ON sb.SEC_REF = t.SEC_REF           
    where t.TRADE_DATE >= to_char(start_date ,'DD-MON-YYYY')
    and t.TRADE_DATE < to_char(end_date ,'DD-MON-YYYY')
    and ct.COST_NAME = 'Broker commission'
    and sb.BUSINESS_CLASS_DEFINITION = 'FTSE';
    END;

Maybe you are looking for