I am fairly new to Crystal Reports. I am working on a report that will call an Oracle Stored Procedure that performs a DB Update to set a last run date for the report. The Stored Procedure takes a string argument parameter to specifiy the report name and stamps the db record with the current system date/time and then returns a REF Cursor. I am having difficulties accomplishing this and appreciate any assistance that can be provided. I have confirmed that the user acct has EXECUTE privilege on the Stored Procedure and UPDATE Privilege on the table.
I can use the Database Expert to browse to the Stored Procedure under the connection and am prompted for the single string parameter that it uses, but when I run the report, I get the following error: Failed to retrieve data from the database. Details: HY000[Oracle][ODBC][ORA] ORA-01456: may not perform insert/delete/update operation inside a READ ONLY transaction.
It appears that Crystal thinks the connection/transaction is Read Only.
I am not sure how to proceed. I have confirmed that my Oracle ODBC Driver Configuration (under Administrative Tools) has Read-Only Connection unchecked.
I have also tried putting the Stored Proc SQL code directly inside a Command but receive Invalid Character if there are more than 1 SQL statement.
I appreciate any ideas on how to perform a database update. We understand that Crystal is a reporting tool, not designed to update the db, however, the sales guy told us we would be able to do this but I cannot figure out how.
-------------------------------------------------------------
Stored Proc:
this is the 'selected table' in CR via DB Expert.
-------------------------------------------------------------
CREATE OR REPLACE PROCEDURE EASDEV."TMP_UPDT_LAST_RUN_PROC"
(InReportName IN varchar2,
p_recordset OUT SYS_REFCURSOR)
is
begin
update options_last_run_tbl set
lst_run_dt = sysdate
where process_nme = InReportName;
commit;
OPEN p_recordset FOR
SELECT LST_RUN_DT, PROCESS_NME
FROM OPTIONS_LAST_RUN_TBL
WHERE process_nme = InReportName;
end;
-------------------------------------------------------------
-------------------------------------------------------------
Direct-In-Line-SQL-Code
-------------------------------------------------------------
update options_last_run_tbl
set lst_run_dt = sysdate
where process_nme = {?InReportName};
commit;
SELECT LST_RUN_DT, PROCESS_NME
FROM OPTIONS_LAST_RUN_TBL
WHERE process_nme = {?InReportName};
-------------------------------------------------------------
thanks
-Bill
Edited by statey603 - 15 Aug 2013 at 2:42am