Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to invoke an Oracle Stored Procedure from Crystal Reports?

Status
Not open for further replies.

akuan

IS-IT--Management
Apr 23, 2002
5
0
0
US
I created a test pkg and a pkg body which will be called by Crystal Reports.

CREATE OR REPLACE PACKAGE epi IS
TYPE wafer_record IS RECORD (
containerid container.containerid%TYPE,
containername container.containername%TYPE
);
TYPE Test_Type IS REF CURSOR RETURN wafer_record;
PROCEDURE epi_wafer(wafer_cursor IN OUT Test_Type);
END epi;
/
show errors;

CREATE OR REPLACE PACKAGE BODY epi IS
PROCEDURE epi_wafer(wafer_cursor IN OUT Test_Type)
IS
BEGIN
OPEN wafer_cursor FOR
SELECT containerid,containername
FROM container
ORDER BY containername;
END epi_wafer;
END epi;
/
show errors;
Both are compiled without error. How do I run it thru SQL*Plus? I tried
SQL> exec epi.epi_wafer;
But got error
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'EPI_WAFER'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

What parameter I need to pass to epi_wafer? Thanks! I also got the same error when I called this Stored Procedure from Cyrstal Report.
 
You cannot base a Crystal Report on an Oracle Package Body. You do have to create a package spec for the ref cursor type, as you did. But the stored procedure has to be created on its own. It cannot be part of the package.:-(

There should be an example at Knowledge Base article #c2008024.
 
How to build the trusted relationship between NT and Window 2000 servers?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top