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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report with Oracle stored procedure (Ref Cursor)

Status
Not open for further replies.

CrystalProgDev

Programmer
Oct 1, 2010
69
US
I have created a package with ref cursor for a crystal report development. I am able to run the package. but when I add that package to the Crystal Reports, it is not showing the fields. same thing is happening with the stored procedure. Can anybody suggest the solution for this problem?
My Stored procedure is something like this.
CREATE OR REPLACE PACKAGE GroupsPackage
AS
TYPE CURSOR_TYPE IS REF CURSOR;
PROCEDURE usp_SelectGroups (int intInputI IN ,Dresults_cursor IN OUT CURSOR_TYPE);
END;
/
CREATE OR REPLACE PACKAGE BODY GroupsPackage
AS
PROCEDURE usp_SelectGroups (int intInputI IN ,results_cursor IN OUT CURSOR_TYPE)
AS
BEGIN
OPEN results_cursor FOR
SELECT GroupID, GroupName, GroupDescription, LastUpdateDate
FROM Groups
ORDER BY GroupName;
END;
END;
/

Thanks in advance
 
Hi,
I am not sure how well Crystal works with packages - try rewriting it as just a Stored Procedure ( not good Oracle programming technique, but it may help isolate where any issues are located)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Same problem with the stored procedure too. I tried both package and stored procedure.
 
Hi,
a couple of additional questions:
What version of CR and Oracle?
What connection type ( ODBC, ADO, native Oracle Server)
Have you had one of this type work before?




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Crystal XI R2, Oracle 10g, OLEDB Connection. Yes I worked on stored procedure in SQL SERVER 2005 for few reports. The SQL server stored procedure that I have worked on are using temp tables with insert stmt. The Stored procedure that I am using now in oracle has ref cursor with select stmt.


 
Hi,
Just to see if it makes a difference, try it with the Native Oracle Server connection type.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi,
Also try defining the REF CURSOR type just as an OUT not an IN OUT ( I know that the docs specify IN OUT, but I have had problems in the past with that)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I tried both the ways as you mentioned. Still the same problem.
Any suggestions.

I really appreciate your help.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top