Avatar of dblerner
dblerner
 asked on

Crystal Reports with Oracle PL/SQL Command Source

I am attempting to get  Crystal Reports to use an Oracle stored procedure as the command source. I have followed the instruction to use a PL/SQL package to set up a Ref Cursor type
and have populated a table with data. When I execute an anonymous block in SQL Developer, it executes successfully and retrieves the data in the table. However, when I place the anonymous block as the command source in Crystal Reports, I get a ORA-0922 error.

Here is the anonymous block:

SET SERVEROUTPUT ON
DECLARE
  CensusRollup_Cursor CensusRollup.CensusRollup_Type;
  resultset CensusRollup_Cursor%rowtype;
BEGIN
  PC_CensusRU_Excel_Test (CensusRollup_Cursor);
  Fetch CensusRollup_Cursor into resultset;
  While CensusRollup_Cursor%found Loop
    DBMS_OUTPUT.Put_Line(resultset.DummyColumn);
    Fetch CensusRollup_Cursor into resultset;
  End Loop;
END;

Do I need to access some settings in Crystal Report for this to work?

I am using an Oracle 10g database, Crystal Reports 12, and a JDBC connection to access the database.
Crystal ReportsOracle Database

Avatar of undefined
Last Comment
dblerner

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Mike McCracken

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
dblerner

ASKER
Thank you for the instructions. I was trying to paste the anonymous block in the command source field. Instead, Crystal Reports lets you choose which stored procedure to use as the command source.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes