COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: dsg1 on 10 Jul 2012 05:09:59 AM

Title: Delete database records using report studio reports
Post by: dsg1 on 10 Jul 2012 05:09:59 AM
Hi,

My report requirement is as follows :

The report displays weekly data. The users need to have the capability to select specific weeks data (passing week # as parameter from the report) and delete those records from the reporting database.

I suppose we can do this with the help of stored procedures and javascripts.

Can anybody please help with the steps or report xml to achieve this ?  This is very much required for my work.


Thanks
dsg


       
Title: Re: Delete database records using report studio reports
Post by: Lynn on 10 Jul 2012 12:47:12 PM
Wow. Sounds like a pretty dangerous thing to implement! It is also not typically the function of a reporting tool to perform data manipulation tasks like this.

I would suggest that whatever tool you use to implement this perform a "logical" or "soft" delete and simply flag data to be removed rather than actually delete it. Then in your FM model you can suppress the return of logically deleted rows. The advantage is that you will be able to recover and "un-delete" when users inevitably mess up.
Title: Re: Delete database records using report studio reports
Post by: wyconian on 12 Jul 2012 02:51:21 AM
Hi

Firstly Lynn is right (as usual :-) ) deleting records is a very dangerous thing to do.  You need to be very sure that this is something you want to do before you do it and you should definatley only do a logical delete that way you can 'undelete' the records if you need to (i.e. when users make a mistake and try to delete the wrong record as they will).

You can't actually delete records using the reporting studios.  What you can do is let the users select the records they want to delete. Save this output as a text file or csv.  You're ETL tool can then read records from this file and add a deleted flag (I'm assuming you're using a datawarehouse and have access to the ETL, Datamanager).

As Lynn said you can then add a filter iin framework manager to either exclude these records or to 'park' them in a different query subject.

If/when you need to undelete them you can just change the deleted flag.

Good luck
Title: Re: Delete database records using report studio reports
Post by: Rahul Ganguli on 12 Jul 2012 05:48:32 AM
Deleting records is possible in report studio reports and now a days I can see a lot of requirement coming for writeback and update functionalities.
But instead of deleting them just update the flag in records, while reporting don't show these records.

You can use stored procedures to implement this.

Regards,
Rahul