Saturday, August 06, 2011

updating MBV download filenames

The MBV files were imported into Telugu stream database without suitably modifying the download filenames. This caused quite a bit of confusion. PB contributed the following post :

Steps done for rectification:

1. In sgh database on saiwaves run the following query:

select 'UPDATE file_id SET download_filename=' || '"' ||download_filename|| '"' || ' WHERE filename="' || filename || '"' from file_id where filename ilike 'MBV%' \t \o update_mandirbhajans.sql ;

First row of the result set looks like:

UPDATE file_id SET download_filename="MBV_04_RAMA_OM_SRI_RAM.mp3" WHERE filename="MBV_04_SUJITH_RAMA_OM SRI RAM.mp3"

2. Save the result set to a file update_mandirbhajans.sql

3. Replace double quotes with single quotes in update_mandirbhajans.sql

4. In sghtelugu database on saiwaves execute the saved update_mandirbhajans.sql (through phpPgAdmin interface)

5. upload the updated csv files / run the update sql statements on the schedule database through the cpanel

No comments:

Post a Comment