Issue with a stored procedure that uses a sys refcursor to output dataset..

Hi All:
I create a stored procedure that uses an in out sys ref cursor:
create or replace procedure FIRE_SALES_100_CALLS_REPORT
( p_cursor in out sys_refcursor)
IS
BEGIN
--Insert into the temp table the records for the rep sales
EXECUTE IMMEDIATE '
INSERT INTO TMP_SALES_CNT_BY_USER
TOTALPRODUCTSSOLD,
NUMBEROFCALLS,
SALESPER100CALLS,
SERVICEORDERNUM,
PRODUCT,
LOGIN,
FST_NAME,
LAST_NAME,
NAME,
POSITIONHELD,
CURRENTPARPARTYID,
QUERY_DATE,
CREATED_BY
SELECT e.TotalProductsSold,
e.NumberOfCalls,
((e.TotalProductsSold/e.NumberOfCalls)*100) AS SalesPer100Calls,
e.ServiceOrderNum,
e.Product,
e.login,
e.fst_name,
e.last_name,
e.name,
e.PositionHeld,
e.CurrentParPartyID,
e.query_date,
e.created_by
FROM (
SELECT COUNT(o.order_num) over ( partition by u.login
order by u.login) AS TotalProductsSold,
SUM(NVL(x.n_inbound,1) + NVL(x.n_outbound,1)) over (partition by u.login
order by u.login) AS NumberOfCalls,
o.order_num AS ServiceOrderNum,
pi.name as Product,
u.login,
c.fst_name,
c.last_name,
postn.name,
c.pr_held_postn_id as PositionHeld,
p.par_party_id as CurrentParPartyID,
NVL(x.query_date,NVL(o.last_upd, null)) AS query_date,
o.created_by
FROM firestg.SEB_S_order o
INNER join firestg.seb_s_order_item oi ON o.row_id = oi.order_id
INNER join firestg.seb_s_prod_int pi ON oi.prod_id = pi.row_id
INNER join firestg.SEB_s_contact c on c.Row_Id = o.created_by
INNER join firestg.SEB_s_user u on u.row_id = o.created_By
INNER join firestg.SEB_s_party p on p.row_id = c.pr_held_postn_id
INNER join firestg.SEB_s_postn postn on postn.row_id = c.pr_held_postn_id
LEFT OUTER JOIN (
SELECT taw.QUERY_DATE,
vaw.n_inbound,
vaw.n_outbound,
oaw.object_name, oaw.object_id
FROM GEN_T_AGENT_WEEK taw
INNER JOIN GEN_V_AGENT_WEEK vaw ON taw.time_key = vaw.time_key
INNER JOIN GEN_O_AGENT_WEEK oaw ON oaw.object_id = vaw.object_id) x
ON u.cti_acd_userid = x.object_name
WHERE NVL(x.query_date,NVL(o.last_upd, null)) BETWEEN (TRUNC (next_day (sysdate, ''SUN''))-14)
AND (TRUNC (next_day (sysdate, ''SUN''))-8)
AND o.status_cd IN (''Complete''))e';
--Lookup the first level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_1ST, LOGIN_1ST,FST_NAME_1ST,LST_NAME_1ST,TITLE_1ST) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.currentparpartyid)
WHERE CurrentParPartyID IS NOT NULL';
--Lookup the second level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_2ND, LOGIN_2ND,FST_NAME_2ND,LST_NAME_2ND,TITLE_2ND) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.ParPartyID_1ST)
WHERE a.ParPartyID_1ST IS NOT NULL';
--Lookup the third level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_3RD, LOGIN_3RD,FST_NAME_3RD,LST_NAME_3RD,TITLE_3RD) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.ParPartyID_2ND)
WHERE a.ParPartyID_2ND IS NOT NULL';
--Lookup the fourth level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_4TH, LOGIN_4TH,FST_NAME_4TH,LST_NAME_4TH,TITLE_4TH) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.ParPartyID_3RD)
WHERE a.ParPartyID_3RD IS NOT NULL';
--Lookup the fifth level to see if there is a higher level person
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET (ParPartyID_5TH, LOGIN_5TH,FST_NAME_5TH,LST_NAME_5TH,TITLE_5TH) =
(SELECT pa.par_party_id,
U.Login,
C.FST_NAME,
C.Last_Name,
p.name
FROM firestg.seb_s_postn p
inner join firestg.seb_s_user U on u.Row_Id = p.pr_emp_id
inner join firestg.seb_s_contact c on c.Row_Id = p.pr_emp_id
INNER join firestg.SEB_s_party pa on pa.row_id = c.pr_held_postn_id
WHERE p.row_id = a.ParPartyID_4TH)
WHERE a.ParPartyID_4TH IS NOT NULL';
-- If there was no 1st place then the rep is a VP
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.last_name || '', '' || a.fst_name,
a.vp_login = a.login
WHERE a.login_1st IS NULL';
--If there is no second place then the rep has a VP and is a Director
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_1st || '', '' || a.fst_name_1st,
a.vp_login = a.login_1st,
a.director = a.last_name || '', '' || a.fst_name,
a.director_login = a.login
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NULL';
--IF there is no third place then the rep has a VP, Director & is a Manager
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_2ND || '', '' || a.fst_name_2ND,
a.vp_login = a.login_2ND,
a.director = a.lst_name_1st || '', '' || a.fst_name_1st,
a.director_login = a.login_1st,
a.manager = a.last_name || '', '' || a.fst_name,
a.manager_login = a.login
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NOT NULL
AND a.login_3rd IS NULL';
--If there is no fourth place then the rep has a VP, Dir, Manager, and is a Supervisor
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_3RD || '', '' || a.fst_name_3RD,
a.vp_login = a.login_3RD,
a.director = a.lst_name_2ND || '', '' || a.fst_name_2ND,
a.director_login = a.login_2ND,
a.manager = a.lst_name_1st || '', '' || a.fst_name_1st,
a.manager_login = a.login_1st,
a.supervisor = a.last_name || '', '' || a.fst_name,
a.supervisor_login = a.login
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NOT NULL
AND a.login_3rd IS NOT NULL
AND a.login_4th IS NULL';
--If there is no fifth plance then the rep has a VP, Dir, Mgr, Supervisor, and is a Team Lead
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_4TH || '', '' || a.fst_name_4TH,
a.vp_login = a.login_4TH,
a.director = a.lst_name_3RD || '', '' || a.fst_name_3RD,
a.director_login = a.login_3RD,
a.manager = a.lst_name_2ND || '', '' || a.fst_name_2ND,
a.manager_login = a.login_2ND,
a.supervisor = a.lst_name_1st || '', '' || a.fst_name_1st,
a.supervisor_login = a.login_1st,
a.teamlead = a.last_name || '', '' || a.fst_name,
a.teamlead_login = a.login
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NOT NULL
AND a.login_3rd IS NOT NULL
AND a.login_4th IS NOT NULL
AND a.login_5th IS NULL';
--If there is a fifth place then the rep has a VP, Dir, Mgr, Supervisor, Team Lead and is a rep
EXECUTE IMMEDIATE '
UPDATE TMP_SALES_CNT_BY_USER a
SET a.vp = a.lst_name_5TH || '', '' || a.fst_name_5TH,
a.vp_login = a.login_5TH,
a.director = a.lst_name_4TH || '', '' || a.fst_name_4TH,
a.director_login = a.login_4TH,
a.manager = a.lst_name_3RD || '', '' || a.fst_name_3RD,
a.manager_login = a.login_3RD,
a.supervisor = a.lst_name_2ND || '', '' || a.fst_name_2ND,
a.supervisor_login = a.login_2ND,
a.teamlead = a.lst_name_1st || '', '' || a.fst_name_1st,
a.teamlead_login = a.login_1st
WHERE a.login_1st IS NOT NULL
AND a.login_2ND IS NOT NULL
AND a.login_3rd IS NOT NULL
AND a.login_4th IS NOT NULL
AND a.login_5th IS NOT NULL';
open p_cursor for
SELECT tsc.vp,
tsc.director,
tsc.manager,
tsc.supervisor,
tsc.teamlead,
(tsc.last_name || ', ' || tsc.fst_name) AS Rep,
tsc.product,
tsc.totalproductssold,
tsc.numberofcalls,
tsc.salesper100calls
FROM TMP_SALES_CNT_BY_USER tsc;
END FIRE_SALES_100_CALLS_REPORT;
The table I use is a Global temp table.
This runs just fine in oracle but when I try to build a data foundation in Business Objects I get the error that says you cannot insert/update/delete in a READ ONLY Transaction.
I really need some advice on what to do since I really dont have access to a scheduled script and table that would store my data ahead of time.

Well, AFAIK, BO is a reporting tool, so it si read-only by nature. I do not know if it possible to "tell" BO table is GTT and it is OK to write to it. You need to post this in BO forum.
SY.

Similar Messages

  • How to call a stored procedure that use a type defined in a package?

    Hi all,
    this is stored procedure:
    GET_GIORNATAEVENTO( in_nome_servizio IN VARCHAR2,
    out_dati_aggiornati OUT TAB_VARCHAR2);
    TAB VARCHAR2 is defined in the package specification:
    TYPE tab_varchar2 IS TABLE OF VARCHAR2(5) INDEX BY BINARY_INTEGER;
    and this is the name of the package: PKG_SERVIZI_MMSPUSH.
    This is my php script:
    <?php
    // Connect to database...
    $c=OCILogon("venus_vfl", "venus_vfl", "venvi");
    if ( ! $c ) {
    echo "Connessione non riuscita: " . var_dump( OCIError() );
    die();
    echo "<br>PKG_SERVIZI_MMSPUSH.GET_GIORNATAEVENTO</br> ";
    echo "<br> </br>";
    // Call database procedure...
    $in_servizio = "MOTO";
    $s = OCIParse($c, "begin PKG_SERVIZI_MMSPUSH.GET_GIORNATAEVENTO(:bind1, :bind2); end;");
    OCIBindByName($s, ":bind1", $in_servizio);
    OCIBindByName($s, ":bind2", $out_esito);
    OCIExecute($s,OCI_DEFAULT);
    echo "OUT_DATI_AGGIORNATI= " . $out_esito;
    // Logoff from Oracle
    OCILogoff($c);
    ?>
    How to test stored procedure to get the output parameter?
    Thanks in advance.

    Thanks,
    but I need to test stored procedures that uses type defined in the package.
    e.g.
    if I have s.p.
    PROCEDURE get_risultati_squadra
    ( in_squadra IN VARCHAR2,
    out_serie OUT tab_varchar2_5,
    out_tiporisultato OUT tab_varchar2_5,
    out_n_giornata OUT tab_varchar2_5,
    out_squadre OUT tab_varchar2_200,
    out_risultato OUT tab_varchar2_10,
    out_marcatore OUT tab_varchar2_50,
    out_punti OUT tab_varchar2_3,
    out_rimbalzista OUT tab_varchar2_50,
    out_rimbalzi OUT tab_varchar2_3,
    out_esito OUT tab_varchar2_2);
    I have to define every type external to the package, in this case five new TYPE !!
    Is there another way to solve this problem?
    Thanks

  • Help! Need oracle help with constructing stored procedure that return resultsets

    Suns tutorial path for returning resultsets from stored procedures indicates that the following should work...
    CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");
    ResultSet rs = cs.executeQuery();
    Thats if you build your stored procedure something like this ...
    String createProcedure = "create procedure SHOW_SUPPLIERS " + "as " + "select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME " + "from SUPPLIERS, COFFEES " + "where SUPPLIERS.SUP_ID = COFFEES.SUP_ID " + "order by SUP_NAME";
    We are using oracle 8.1.6. However I've been told that with oracle procedures when you return a result set from a called procedure you return a p_cursor variable. Somthing like this
    (p_cursor in out SHOW_SUPPLIERS.SHOCurTyp)
    is
    begin
    open p_cursor for
    select * from suppliers
    In which case the above mentioned sun code doesn't work.
    We want to use jdbc to call a stored procedure that returns a resultset that does not require us to import any proprietary oracle objects...
    Is there another way to write these stored procedures, rather than using this cursor construct? Are we missing something in the way we invoke them?

    Suns tutorial path for returning resultsets from stored procedures indicates that the following should work...
    CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");
    ResultSet rs = cs.executeQuery();
    Thats if you build your stored procedure something like this ...
    String createProcedure = "create procedure SHOW_SUPPLIERS " + "as " + "select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME " + "from SUPPLIERS, COFFEES " + "where SUPPLIERS.SUP_ID = COFFEES.SUP_ID " + "order by SUP_NAME";
    We are using oracle 8.1.6. However I've been told that with oracle procedures when you return a result set from a called procedure you return a p_cursor variable. Somthing like this
    (p_cursor in out SHOW_SUPPLIERS.SHOCurTyp)
    is
    begin
    open p_cursor for
    select * from suppliers
    In which case the above mentioned sun code doesn't work.
    We want to use jdbc to call a stored procedure that returns a resultset that does not require us to import any proprietary oracle objects...
    Is there another way to write these stored procedures, rather than using this cursor construct? Are we missing something in the way we invoke them?

  • 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

  • Issue with Calling Stored procedure in DeskiXIR2

    I have similar requirment.
    I have created a procedure like below
    CREATE OR REPLACE PROCEDURE TEST_1(
    g_id IN employee.employee_id%type,
    e_id OUT employee.employee_id%type,
    f_name OUT employee.first_name%type,
    l_name OUT employee.last_name%type)
    IS
    BEGIN
    select employee_id, first_name, last_name into e_id, f_name, l_name from employee where employee_id=g_id;
    end TEST_1;
    when i tried to create a report using other dataprovider: Stored procuedure in deski, i am getting only one parameter in the parameter window g_id and i gave the value(correct) but its giving the below error
    Exception: DBD, ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TEST_1'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    State: N/A
    the same procedure working fine in database:
    DECLARE
    e_id number;
    f_name VARCHAR2(20);
    l_name VARCHAR2(20);
    BEGIN
    Test_1(1111,e_id,f_name,l_name) ;
    DBMS_OUTPUT.PUT_LINE('TEST'||e_id||f_name||l_name);
    END;
    Please help me to resolve the issue.
    Thanks,

    Hi,
    Check for the data type you are giving as input to the prompt in BO. In order to test that give existing avlues for the parameter.
    Cheers,
    Suresh Babu Aluri.

  • 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

  • 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.

  • Invoking Stored procedures without using CallableStatement

    I have a piece of code:
    import java.sql.*;
    public class Somenath{
    public static void main(String args[])throws ClassNotFoundException,SQLException{
    String abc;
    String query="{ call PR_EXAMPLE_I(?,?) }";
    String name="TEST FUND 2";
    Connection con = null;
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con=DriverManager.getConnection("jdbc:oracle:thin:@172.16.31.120:1521:ora9db","gs2","gs2");
    Statement statement=con.createStatement();
    CallableStatement cs = con.prepareCall(query);
    cs.registerOutParameter(2,Types.VARCHAR);
    cs.setString(1,name);
    cs.execute();
    String nameval=cs.getString(2);
    System.out.println("Name"+nameval);
    try{
    finally{
    cs.close();
    This code works fine.
    I would like to know wheather its possible to execute a stored procedure using the
    statement.execute()/statement.executeQuery().Please note as per Java's documentation statement.execute() may be used execute any unknown SQL String.So is it possible to execute a stored procedure thats already existing(say PR_EXAMPLE_I in the current example).

    Thank you Digital Dreamer for ur help.I will explain the problem in detail.
    Well I wish to invoke a stored procedure that uses a in paramater but no out parameter.Assume that the stored procedure (say abc) already exists in the system.We execute a Select statement inside the Stored procedure and copy the value in a block-variable(a local one) within the Stored Procedure.
    Usually we execute the stored procedure in the SQL Prompt using
    SQL> exec Proc_Name(In Paramter)
    I would like to know how do I do it in JDBC using Statement.(Please note that we are not using Callable Statement)
    Can u help me out with an example?

  • How to wrap a stored procedure that outputs PL/SQL records for JDBC?

    Hello everybody,
    Is there an example for wrapping a stored procedure that outputs PL/SQL records and/or PL/SQL tables of records, so that it can be called from JDBC?
    Since this is not possible with the Oracle JDBC driver, Oracle recommends "To wrap a stored procedure that uses PL/SQL tables, break the data into components or perhaps use Oracle collection types." (http://download-west.oracle.com/docs/cd/B12037_01/java.101/b10979/ref.htm#sthref2123)
    Many thanks for any help,
    Cheers, Christoph

    Hi Christoph,
    Have you tried using JPublisher, or -more easily- JDeveloper (Go to your database connection in the "Connections" pane, open the "Packages" node, right click to "Generate Java...").
    These approaches (at minimum, use of jpub) will generate required PL/SQL wrapper code, including SQL Type declarations. Once these are installed in the database, you can invoke the wrapper procedures directly from Java.
    -- Ekkehard

  • How to call a stored procedure that has Table Of data types in VB6?

    Hi everyone,
    I need to call a stored procedure that has a Table Of data type as an input parameter (possibly even several Table Of input parameters). I can't seem to find any example of how to do this in VB6 using ODBC. Is this even possible?
    Thanks you!
    Steve

    Thanks,
    but I need to test stored procedures that uses type defined in the package.
    e.g.
    if I have s.p.
    PROCEDURE get_risultati_squadra
    ( in_squadra IN VARCHAR2,
    out_serie OUT tab_varchar2_5,
    out_tiporisultato OUT tab_varchar2_5,
    out_n_giornata OUT tab_varchar2_5,
    out_squadre OUT tab_varchar2_200,
    out_risultato OUT tab_varchar2_10,
    out_marcatore OUT tab_varchar2_50,
    out_punti OUT tab_varchar2_3,
    out_rimbalzista OUT tab_varchar2_50,
    out_rimbalzi OUT tab_varchar2_3,
    out_esito OUT tab_varchar2_2);
    I have to define every type external to the package, in this case five new TYPE !!
    Is there another way to solve this problem?
    Thanks

  • Call a Stored Procedure that returns a REFCURSOR using ODI Procedure

    Hi,
    I have a scenario wherein the stored procedure (TEST_PROC1) that returns a REFCURSOR. The second procedure(TEST_PROC2) will use the REFCURSOR as inpuut and insert it to a table.
    Now, I need to execute the test procedures (TEST_PROC1 and TEST_PROC2) using the ODI Procedure but I always get error. However, I was able to execute the test procedures using sqlplus. Here is the command I used for sqlplus:
                   var rc refcursor
                   exec TEST_PROC1(:rc);
                   exec TEST_PROC2(:rc);
    PL/SQL Stored Procedure:
    -- TEST_PROC1 --
    create or replace
    PROCEDURE TEST_PROC1 (p_cursor IN OUT SYS_REFCURSOR)
    AS
    BEGIN
    OPEN p_cursor FOR
    SELECT *
    FROM test_table1;
    END;
    -- TEST_PROC2 --
    create or replace
    procedure TEST_PROC2( rc in out sys_refcursor ) is
    FETCH_LIMIT constant integer := 100;
    type TFetchBuffer is table of test_table2%RowType;
    buffer TFetchBuffer;
    begin
    loop
    fetch rc bulk collect into buffer limit FETCH_LIMIT;
    forall i in 1..buffer.Count
    insert into test_table2(
    c1, c2
    ) values(
    buffer(i).c1, buffer(i).c2
    exit when rc%NotFound;
    end loop;
    end;
    Is there a way to call a PL/SQL Stored Procedure that returns a REFCURSOR using ODI Procedure?
    Thanks,
    Cathy

    Thanks for the reply actdi.
    The procedure TEST_PROC1 is just a sample procedure. The requirement is that I need to call a stored procedure that returns a cursor using ODI and fetch the data and insert into a table, which in this case is test_table2.
    I was able to execute a simple SQL procedure (without cursor) using ODI procedure. But when i try to execute the SQL procedure with cursor in ODI, I encountered error.
    Do you have any idea how to do this?

  • Hey guys ive got issues with my macbook pro that i bought not a year ago, and for the last week its just randomly restarting especially when im watching a video or using finalcut pro x can someone help me?

    hey guys ive got issues with my macbook pro that i bought not a year ago, and for the last week its just randomly restarting especially when im watching a video or using finalcut pro x can someone help me?

    What do you mean "Leave them my laptop again"? do you mean you have had it worked on before? for the same problem or a different one?
    You need to take it in to Apple ASAP. No matter how long they have it, you want it fixed and fixed correctly.
    top_cheese_1 wrote:
    i bought it june 2012.. still on the warranty. i just didnt wanted to leave them my laptop again, but ok if you think thats what i should do..

  • Using XI - RFC table and an Oracle stored procedure that returns a cursor.

    I need to create an interface using XI between an RFC table and an Oracle stored procedure that returns a cursor.  We are on oarcle 9.2 and  SP12.
    My stored procedure looks something like this:
    CREATE OR REPLACE
    PROCEDURE testproc_xi2 (p_recordset1 OUT SYS_REFCURSOR,
                                             in_quoteid IN varchar2 )
    AS
    BEGIN
      OPEN p_recordset1 FOR
       SELECT  q.quote_id,
                     q.modified_by,
                     q.quote_status,
                     q.total_cost
                FROM quote q
               WHERE q.quote_id = in_quoteid
                 AND q.total_cost > 0 ; 
    END testproc_xi2 ;
    My RFC has table and  one import parameter .
    I wanted to know how to create the data type for the ref cursor? and also for the table type in the RFC?
    CAN XI handle multi rows coming from a Stored procedure? Are there any other alternative methods if this is not supported?Any pointers to this would be helpful.
    I have called a Oracle SP from an RFC before, but that interface had one input parameter going to the stored procedure from the RFC and about 6 o/p parameters coming from the Stored procedure. This works fine.
    Thanks for the help.
    Mala

    Mala,
    i dont think there is anything called an rfc table...RFC stands for remote function call. That in essence would imply you need a rfc to jdbc connection.
    yes XI can handle multiple rows cooming from the the stored procedure if you have them mapped appropriately.
    Now as to how to create the data type within xi , you need to know what fields are going to be returned and whether they are nested and then just create them as you would for an xml
    for ex
    <Details>
      <FirstName>
    <LastName>
    </Details>
    that in xi would be smthing like
    Details  type of data occurence
    FirstName type of data occurence
    LastName type of data occurence.
    Hope that helps.
    If it does dont forget the points..:-)

  • MySQL to DreamWeaver connectivity issue specific to Stored Procedures

    Hi there,
    I have a MySQL to DreamWeaver connectivity issue specific to
    Stored Procedures.
    The driver I am currently using is
    mysql-connector-java-5.1.5-bin.jar.
    Although basic row and column tree is exposed in Adobe
    DreamWeaver 8's Application Pallette, my stored procedure is not.
    My serverside technology is Coldfusion(MX7).
    My environment is:
    Server: MS Windows 2003 (Small Business Server) using IIS.
    Client: MS Window XP-Pro.
    According to the driver documentation
    mysql-connector-java-5.1.5-bin.jar appears to be capable of
    handling stored procedures:
    http://dev.mysql.com/doc/refman/5.1/en/connector-j-useagenotes-basic.html#connector-j-exam ples-stored-procedure
    I could be wrong but the evidence suggests that support for
    this feature is not available from Adobe.
    I have already invested a certain amount of time in this
    sub-project. I would, therefore, be most grateful to anyone who can
    provide me with a solution to this.

    OK.
    Figured out the 'stored proceedure' problem. I had two 'Connection' folders, one of which was a sub-folder, that pointed to the same database but with slightly different configuration details. Removed the 'wrong' folder and all seems to be sorted.
    P

  • 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

Maybe you are looking for

  • Got SQL *Plus query output in more than one in a single page

    Hi All, I have write a SQL *Plus code for execute one SQL query and registered as concurrent program. But I have got the output more than once in a single page after running the concurrent program. I am not getting what is the my code problem. Please

  • Hiding the Comments in SE38 Display Mode

    Hi Folks, Is it possible to Hide the comments when a program is seen in uneditable mode either in SE38 or SE80.I am using 4.7. If not in 4.7 kindly let me know if any of the upcoming versions have this facility. Thanks, K.Kiran.

  • Why do JCo destinations green in designtime, fail during runtime ?

    Manually verified JCo destination, both ping and test works. Ran the WebDynpro console sanity check tool. All tests green. When the application then tries to create a Jco connection during runtime I get these logs in defaultTrace on EP: Could not cre

  • Diff. btw. xxContainerRenderer.renderShowHeader() and renderPortletHeader()

    Hi, Can anyone explain the diff. betw. the renderShowHeader() and renderPortletHeader() methods of the xxxContainerRenderer Class ? The the only diff I see is that the renderShowHeader() has a PrintWriter parameter indicating that it prints it out it

  • Firefox for aol dose not work with aol emails.Why

    Since the email inter face changed I can no longer send email attachments, even items embeded in the email body come out blank at the other end. I use Firefox configured for AOL but that dose not make any difference. I had no problems untill this cha