Solved

Crystal Reports 8.5 with Oracle Stored Procedures

Posted on 2002-06-11
3
1,298 Views
Last Modified: 2010-08-05
I'm trying to use CR with an Oracle stored procedure.

I'm running:
CR 8.5 developer edition
Oracle 8.1.7
and I'm using the odbc drivers that crystal recommend (contained in the Cror815.zip download).

I'm just trying to use the following simple stored procedure:

-----------------------------------------------
CREATE OR REPLACE PACKAGE b2b_report
AS TYPE b2bcur IS REF CURSOR RETURN table_contract%rowtype;

PROCEDURE GetRecords(p_cursor IN OUT b2b_report.b2bcur, startdate IN DATE);
END b2b_report;
/
CREATE OR REPLACE PACKAGE BODY b2b_report
AS
PROCEDURE GetRecords(p_cursor IN OUT b2b_report.b2bcur, startdate IN DATE)
IS
BEGIN
OPEN p_cursor FOR
SELECT * FROM table_contract WHERE table_contract.create_dt > To_Date(startdate, 'DD/MM/YYYY');
END GetRecords;
END b2b_report;
/
-----------------------------------------------------

but when I create a new report and try and reference the stored procedure via the data explorer, I get the following error message:

ODBC error: [MERANT][ODBC Oracle 8 driver][Oracle 8]ORA-06550: line 1, column 27: PLS-00306: wrong number or types of arguments in call to 'GETRECORDS' ORA-06550: line1, column 8:
PL/SQL: Statement Ignored
0
Comment
Question by:DBowley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
mdonley earned 100 total points
ID: 7070701
You should make your cursor the last parameter and make sure it is listed as an "OUT", not "IN OUT"

Also, try using the CROR8V36 DSN as your datasource.

0
 

Author Comment

by:DBowley
ID: 7072279
The Crystal Reports white paper states that the REF cursor should be defined as IN OUT (so SCR can FETCH every row from the query's result) and the user-defined parameters must be defined after the cursor.
0
 

Expert Comment

by:mdonley
ID: 7073279
I have that same white paper sitting at my desk and highlighted all over the place.  However, I was never able to get it to work that way.  I then took one of the existing stored procedures from elsewhere in my project and attempted to create a report from it and it worked.

The only difference was having the cursor as the last parameter and specified as OUT.

Also, you will want to go into your ODBC admin and set an option on the CROR8V36 DSN called "Procedure returns results".

I hope this helps more than that white paper.

Mike.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

623 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