Deleting old versions of a view

Angela Orbien shared this question 6 years ago
Answered

As we always edit views in using the CLONE option, we have some views that have very old versions that we anyway don't want to recover.

Does anyone have an SQL to safely delete old versions of a view? The higher the number of versions the worse the performance is when editing the view in CLONE mode.

Thanks

A

Replies (3)

photo
1

Hi Angela,

Thanks for your email.

Please run this below SQL to delete the records from the table "reportView". The syntax may be different depending on your database.

You need to type in the View name.

Example:

Delete FROM reportview where ViewDescription like '%timedate%' and ViewStatusCode='Replaced';

Please let me know if you have any questions.

*** Please take a backup of Yellowfin Configure Database to be on safe side. If something goes wrong please restore the Yellowfin Configuration database.

Regards,

Mahesh

photo
1

Thanks. What if we want to keep the 3 most recent ones but delete the rest?

Will this also work for reports? where the reportstatuscode = archived?

photo
photo
1

Hi Angela,

Yes, if you want to delete specific records, first run the select statement and make a note of the ViewId of both the Replaced and Archived records and then run the Delete statement.

Please let me know if you have any questions.

Regards.

Mahesh

photo
1

Hi Angela,

Hope you are doing good.

As it's been bit long without any communication, I will mark this ticket as completed.

If you still have any questions on this ticket please reply back.

Regards,

Mahesh

Leave a Comment
 
Attach a file