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

calling stored procedure


RND3i

Recommended Posts

Hi All,

 

can anyone tell me how to call procedure using iReport.

i have a procedure which includes cursor and i have to retreive the data fetched by the cursor.I thought to store the data in temp table and select from temp but i could not write the query.

 

Any help in this regard is highly appreciated.

Thanks in advance.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You can't 'call a stored procedure', but you can select from a function that references a stored procedure:

 

 

eg1. SELECT myFunction() FROM DUAL;

eg2. SELECT site_code, getSiteNameFromCode(site_code) FROM ActiveSitesVw;

 

 

A function can only return a single value per row to an SQl query, so if you want more than one value to be returned then you have to set up multiple functions or call the same function mutliple times with different parameter settings.

 

 

For most iReport applications it would be better not to call a function that retrieves information from a procedure that is based on a cursor. Instead, put the cursor statement into the main report or a subreport and simply call the function that acts on the contents of the cursor's return values, like in eg2. above.

Link to comment
Share on other sites

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...