Solved

Crystal Reports 8.5 with Oracle Stored Procedures

Posted on 2002-06-11
3
1,263 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

20 Experts available now in Live!

Get 1:1 Help Now