To do multible compids, use the following script:
php /var/www/html_j3sg/institutions/ChangeCompidOfAllInstitutionalAfewCompaniesAtATime.php
Please note that the script mentioned above (ChangeCompidOfAllInstitutionalAfewCompaniesAtATime) only updates the current13FFilingpositions table, no archived tables.

This script actual updates 13F current table as well as both archive13F tables.

We got coming in compid: : 130584
SELECT companies.* , sectors.level3des FROM companies, sectors WHERE companies.sector = sectors.level3num and compid = '130584'

The Shares Amount is 32159000

The cusip is 988858106
NOT OLD

Retrive Rows from Table:
select * from current13Fpositions where cusip = '988858106'
Number of Rows :98

update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '394.91' where entryId = '1115479'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '2.27' where entryId = '1265718'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '208.74' where entryId = '1570468'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.01' where entryId = '1828380'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '13.65' where entryId = '2355039'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.11' where entryId = '2833802'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '2.45' where entryId = '3507811'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '17.57' where entryId = '3735423'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '3.13' where entryId = '4113395'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '5.13' where entryId = '5482970'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '14.4' where entryId = '6416877'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '156.89' where entryId = '7530410'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '928.8' where entryId = '9342703'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '7.3' where entryId = '9758026'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '240.16' where entryId = '10253867'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '56.69' where entryId = '11103843'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '11153044'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '31.52' where entryId = '11387992'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '66.2' where entryId = '11450422'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '11984387'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '17.23' where entryId = '12125513'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '12327558'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '327.22' where entryId = '12525665'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.37' where entryId = '12987534'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '2.49' where entryId = '13468509'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '12.67' where entryId = '13618502'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '13678872'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '1090.75' where entryId = '14098810'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '7.43' where entryId = '14328911'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '20.69' where entryId = '14333280'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '2.62' where entryId = '14354305'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '273.45' where entryId = '14509790'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '2.49' where entryId = '14662150'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.57' where entryId = '14879626'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '427.23' where entryId = '14950223'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '12.57' where entryId = '15053436'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '333.02' where entryId = '15091058'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '982.71' where entryId = '15160385'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '15262645'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '34.95' where entryId = '15303692'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '19.19' where entryId = '15341543'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '5.62' where entryId = '15450890'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '220.25' where entryId = '15556452'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '1.53' where entryId = '16041955'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.93' where entryId = '16118342'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '2.09' where entryId = '16583073'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '16616012'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.84' where entryId = '16673237'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.84' where entryId = '16800277'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '5.55' where entryId = '16836095'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '474.07' where entryId = '16885139'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '366.66' where entryId = '16908804'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '51.67' where entryId = '16918888'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '1.63' where entryId = '16939741'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '135.05' where entryId = '16984339'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.88' where entryId = '17016863'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '17075431'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '17104961'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '146.18' where entryId = '17208884'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '1.43' where entryId = '17468859'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.93' where entryId = '17541627'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '1.74' where entryId = '17558449'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '3.15' where entryId = '18048814'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '18058309'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '454.69' where entryId = '18276558'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '177.48' where entryId = '18291544'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '5.22' where entryId = '18299211'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '58.89' where entryId = '18489563'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '2.64' where entryId = '19116552'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '20920110'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '35.74' where entryId = '23079143'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '25.94' where entryId = '23179788'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '23652748'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '24504843'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '24523122'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '24927997'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '3.04' where entryId = '31800501'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '5.4' where entryId = '32908899'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.93' where entryId = '33104512'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '9.92' where entryId = '36944103'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.32' where entryId = '37278600'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '37905255'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '17.6' where entryId = '42107759'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '27.58' where entryId = '42134405'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '43.77' where entryId = '42157134'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '33.73' where entryId = '42159164'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0.32' where entryId = '42164146'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '82.19' where entryId = '42172670'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '147.51' where entryId = '42175244'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '2.99' where entryId = '42222427'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '8.35' where entryId = '42226297'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '42470125'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '4.67' where entryId = '42499421'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '44.77' where entryId = '44261251'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '7.04' where entryId = '44306728'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '47650083'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '47664261'
update current13Fpositions set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' , percentOut = '0' where entryId = '130461788'
End Function

Retrive Rows from Table:
select * from archive13F where cusip = '988858106'
Number of Rows :24

update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '970293'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '47662759'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '77782807'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '79947014'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '81762865'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '83868460'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '86104015'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '87805063'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '90136405'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '92206404'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '94255490'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '96030051'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '98418952'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '100991010'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '103551463'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '105766415'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '109070095'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '111857378'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '114288874'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '116762858'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '119648025'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '122412156'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '124956948'
update archive13F set compid = '130584', sectorNum = '106002', sectorDes = 'Jewelry Stores', issuerCik = '0000109156' where entryId = '127818091'
End Function
The Script is complete, exiting....