I am trying to use an oracle stored procedure in a crystal report, using Oracle 8.1.7.00 and Crystal 8.5. The code for the procedure and related objects are shown below and were created in the its1 schema. I am trying to run the report logged on as user reports. I get different results depending on the driver I select, but not any are successful.
a) using a Oracle 8.01.73.00 ODBC driver logged in as reports,
I get the following error:
ORA-01456: may not perform insert/delete/update operation inside a READ ONLY transaction.
(the properties for the ODBC driver has 'enable result sets' checked and 'read only conection' unchecked)
b) using the CR Oracle8 ODBC driver logged in as its1 (if logged in as reports with the driver property set to show procedures from other schemas, its locks up), I get thousands of records returned and I stop run, because I should only be getting back 8 records.
c) using the oracle native driver logged in as reports, I get back thousand of records like case (b) above.
I have tested this procedure in sqlplus and it returned the 8 rows expected. I tested the procedure using sqlcon32 (odbc tool from crystal site) using the driver in case (a) above and it worked fine, but using the driver in case (b)
above I got the same result as when I tried it in crystal.
Any ideas why I am having a problem?
1.
CREATE GLOBAL TEMPORARY TABLE MC_TMP_TEST
(
SRVNO VARCHAR2(9),
SRVKEY NUMBER(9),
PART_COST NUMBER(11,2),
LABR_COST NUMBER(11,2)
)
ON COMMIT PRESERVE ROWS;
GRANT DELETE, INSERT, SELECT, UPDATE ON MC_TMP_TEST TO REPORTS;
2.
CREATE OR REPLACE package test_package
as type test_type is ref cursor return mc_tmp_test%rowtype;
end test_package;
GRANT EXECUTE ON TEST_PACKAGE TO REPORTS;
3.
CREATE OR REPLACE PROCEDURE Test_Procedure (
Test_Cursor IN OUT its1.Test_Package.Test_Type)
AS
BEGIN
INSERT INTO IMSV7.MC_TMP_TEST
(SELECT srvno, srvkey, 0, 0 FROM ITS1.HISTORY WHERE COMPDTTM > '01-JUN-2004');
open Test_Cursor for
select * from its1.mc_tmp_test;
END ;
GRANT EXECUTE ON TEST_PROCEDURE TO REPORTS;
a) using a Oracle 8.01.73.00 ODBC driver logged in as reports,
I get the following error:
ORA-01456: may not perform insert/delete/update operation inside a READ ONLY transaction.
(the properties for the ODBC driver has 'enable result sets' checked and 'read only conection' unchecked)
b) using the CR Oracle8 ODBC driver logged in as its1 (if logged in as reports with the driver property set to show procedures from other schemas, its locks up), I get thousands of records returned and I stop run, because I should only be getting back 8 records.
c) using the oracle native driver logged in as reports, I get back thousand of records like case (b) above.
I have tested this procedure in sqlplus and it returned the 8 rows expected. I tested the procedure using sqlcon32 (odbc tool from crystal site) using the driver in case (a) above and it worked fine, but using the driver in case (b)
above I got the same result as when I tried it in crystal.
Any ideas why I am having a problem?
1.
CREATE GLOBAL TEMPORARY TABLE MC_TMP_TEST
(
SRVNO VARCHAR2(9),
SRVKEY NUMBER(9),
PART_COST NUMBER(11,2),
LABR_COST NUMBER(11,2)
)
ON COMMIT PRESERVE ROWS;
GRANT DELETE, INSERT, SELECT, UPDATE ON MC_TMP_TEST TO REPORTS;
2.
CREATE OR REPLACE package test_package
as type test_type is ref cursor return mc_tmp_test%rowtype;
end test_package;
GRANT EXECUTE ON TEST_PACKAGE TO REPORTS;
3.
CREATE OR REPLACE PROCEDURE Test_Procedure (
Test_Cursor IN OUT its1.Test_Package.Test_Type)
AS
BEGIN
INSERT INTO IMSV7.MC_TMP_TEST
(SELECT srvno, srvkey, 0, 0 FROM ITS1.HISTORY WHERE COMPDTTM > '01-JUN-2004');
open Test_Cursor for
select * from its1.mc_tmp_test;
END ;
GRANT EXECUTE ON TEST_PROCEDURE TO REPORTS;