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

Update retrieved records


DocJones

Recommended Posts

Heyas,

i am looking for a possibility to update selected records for a report to prevent them being reported more than once.

I have an Mutli-Select Query Control, retrieving certain records from a table to be put onto a report. I want to be able to "flag" them as "exported" upon report generation to prevent them showing up in subsequent calls to the report via JasperServer.

Has anyone done this already? Is there a possibility to achieve this?

Technically it would require the JDBC statement to be created with a ResultSet.CONCUR_UPDATEABLE flag and allowing JasperServer setting the flag to a given value (ideally a TIMESTAMP value set to CURRENT_TIMESTAMP).

Any help is appreciated.

regards

/M

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 Some time ago, I asked on this forum if it was possible to update records via jasperreport. I was answered "No, it is not possible".

But I did some tries and finally found it was possible by using a "stored function" (I am running Oracle Database)  which contents the update statements and returns anythinh like 0 or "OK". The "main query" of the report just makes a call to this function. By using sub reports or datasets in the right order it should be possible to sequence the queries in order to get the aimed result.

I tested and it was working but finally I didn't use.

All that to say that it is possible to update records but using this capability to solve your problem seems rather complex.

Perhaps this will help you

Link to comment
Share on other sites

Heyas,

thanks for your input. From my oracle expirience, i would consider it possible and easily done. But i am using a DB/2 database, where its forbidden to call UDF (user defined funtions) with an SQL access level "MODIFIES SQL DATA" within a query.

I was hoping for a supported method from JasperServer's point of view.

Thanks and regards

/M

Link to comment
Share on other sites

 Not sure if this is any help, but when I have tried to do an INSERT or an UPDATE in a Report query it runs the command successfully when I click "read fields" and then gives me a Cursor State not valid error.  

I haven't been able to get this working when the report runs, but it might be a start.

This is on the com.ibm.as400.access.AS400JDBCDriver .

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