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: : 130715
SELECT companies.* , sectors.level3des FROM companies, sectors WHERE companies.sector = sectors.level3num and compid = '130715'

The Shares Amount is 54156000

The cusip is 78423R105
NOT OLD

Retrive Rows from Table:
select * from current13Fpositions where cusip = '78423R105'
Number of Rows :36

update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.23' where entryId = '40851105'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0' where entryId = '40864004'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '1.42' where entryId = '41007486'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '4.84' where entryId = '41652184'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '3.71' where entryId = '41675393'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '3.07' where entryId = '42065388'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '63.89' where entryId = '42070282'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '18.11' where entryId = '42107195'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '2.14' where entryId = '42115270'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.37' where entryId = '42120102'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '8.01' where entryId = '42125910'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.06' where entryId = '42142673'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '33.27' where entryId = '42143708'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '7.01' where entryId = '42146862'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '9.31' where entryId = '42153164'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.69' where entryId = '42158809'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.68' where entryId = '42163766'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.16' where entryId = '42165191'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '37.2' where entryId = '42172367'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.26' where entryId = '42182017'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '36.93' where entryId = '42186840'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.09' where entryId = '42191968'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.11' where entryId = '42202213'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '3.13' where entryId = '42209062'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '3.93' where entryId = '42222306'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '8.55' where entryId = '42225718'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '978.21' where entryId = '42231417'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '70.96' where entryId = '42234772'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.03' where entryId = '42240547'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '1.96' where entryId = '42246200'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '543.53' where entryId = '42248271'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0' where entryId = '42468400'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0' where entryId = '42469094'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0.31' where entryId = '43980598'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0' where entryId = '46371228'
update current13Fpositions set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' , percentOut = '0' where entryId = '47013746'
End Function

Retrive Rows from Table:
select * from archive13F where cusip = '78423R105'
Number of Rows :1

update archive13F set compid = '130715', sectorNum = '504001', sectorDes = 'Diversified Machinery', issuerCik = '0000718789' where entryId = '47662750'
End Function
The Script is complete, exiting....