Solved

Crystal Reports Developer XI and Oracle 10g Stored Procedure results

Posted on 2007-11-30
5
1,955 Views
Last Modified: 2013-12-18
I'm very new to Oracle so this may be a very simple issue.   I've used SQL Server and Crystal extensively so I have that "handicap".   I have a package with a stored procedure that does a lot of work and stores the results to a global temporary table.   I then need to select that information from the table and return it to Crystal to report.

Here is what I've tried:

I have added a SYS_REFCURSOR as an output parameter to the stored procedure and at the bottom of the stored procedure I have opened the cursor with the select of the global table.  

I connect the stored procedure to crystal using a JDBC connection.   When I do this, everything looks as I would expect it within Crystal.   I see the field names and all expected field information.   The problem comes when I try to run the report.   I receive the error "Failed to retrieve data from the database".   I have granted execute to public even though I'm connecting as the database user.

I have also tried creating a new package that calls the original stored procedure and then calls the select and returns the cursor.  Kind of a wrapper stored procedure.  However, I receive the same error message with that.

I'm sure there is something I'm missing that is pretty straight forward.   All help would be greatly appreciated.

Thank you
khughes1101
0
Comment
Question by:khughes1101
  • 3
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 20385268
I don't use Oracle but from what I have read here, the ref cursor must be the first parameter in the stored procedure.

mlmcc
0
 

Author Comment

by:khughes1101
ID: 20385307
I've tried it as the first and last parameter.  No difference in the resulting error message.   Any other ideas I might try?

I have been able to put together a package with a stored procedure with just a straight select on a "regular" table - not a global temporary table and report on that fine.   I'm not sure if the difference is between a temporary table verses a standard table or the fact that I'm running the stored procedure prior to accessing the temporary table.

I'm also able to report against the temporary table, but as you would expect I do not have data in it.   At least the report runs without errors.
0
 

Accepted Solution

by:
khughes1101 earned 0 total points
ID: 20385360
I believe I determined the problem.   I had to change the table definition to include "ON COMMIT PRESERVE ROWS".   Originally it was "ON COMMIT DELETE ROWS".   In the test I ran this resolved the problem.  I will try it out and make sure it works.

Thank you for all of your help.
0
 

Author Comment

by:khughes1101
ID: 20385500
The change worked.

Can I request here that this question be closed as I have resolved my own question?

Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now