Jump to content
We've recently updated our Privacy Statement, available here ×

How to call oracle (PLSQL) Stored procedures from ireport designer?


daad.madhusudan
Go to solution Solved by daad.madhusudan,

Recommended Posts

I have written following stored procedure to test procedure call from iReport designer.

 

Stored Procedure:

 

    CREATE OR REPLACE PROCEDURE test(cursor1 out sys_refcursor) IS

      BEGIN

        OPEN cursor1 for 

          select person_id,first_name

          from person

          where rownum < 5;

      END; 

 

 

In my query window I am using following line to call this procedure.

 

    {call test($P{cursor})}

 

where $P{cursor} is a parameter with class java.sql.ResultSet.

 

I have added ojdbc.jar file into my class path and connection is also successful.

 

When I run above statement for calling stored procedure it throws the error:

 

    Error: java.sql.SqlException:Invalid column type

 

Can someone tell me what I did wrong here? AM i supposed to add any file or make any changes in the call to stored procedure?

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution
The problem was in iReport field extractor. The solution for above problem is, we should analyse our stored procedure and create fields in iReport designer with the same name which are present in select clause of stored procedure.

 

After creating stored procedure, just drag and drop the fields on the report are and execute it. It will show the retrieved data.

 

This solution worked for me, so I am sharing it with you.

Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...