Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Reports 8.5 with Oracle Stored Procedures

Posted on 2002-06-11
3
Medium Priority
?
1,302 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 300 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 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