Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: CR2011 v14; Read Only Trans Err calling Updt SProc Post Reply Post New Topic
Author Message
statey603
Groupie
Groupie
Avatar

Joined: 14 Aug 2013
Online Status: Offline
Posts: 78
Quote statey603 Replybullet Topic: CR2011 v14; Read Only Trans Err calling Updt SProc
     Posted: 15 Aug 2013 at 2:28am
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
-bill
IP IP Logged
statey603
Groupie
Groupie
Avatar

Joined: 14 Aug 2013
Online Status: Offline
Posts: 78
Quote statey603 Replybullet Posted: 23 Aug 2013 at 8:17am
SOLUTION:
 
Use Native Connection [not ODBC]
Put Formula in main report containing Shared variable
Assign Stored Procedure Input Parameter value into Shared Variable
Add subReport with Data Source = Stored Procedure
Link subReport to main report by joining the Shared Variable to the Stored Proc Input Param
 
-bill
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum