Solved

Crystal Reports 8.5 with Oracle Stored Procedures

Posted on 2002-06-11
3
1,283 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
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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