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

The Shares Amount is 38210000

The cusip is 040049108
NOT OLD

Retrive Rows from Table:
select * from current13Fpositions where cusip = '040049108'
Number of Rows :78

update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '2.7' where entryId = '2830820'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0.58' where entryId = '3726263'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '4416965'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '4436118'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '5.13' where entryId = '5455142'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '57.76' where entryId = '6949339'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '9.16' where entryId = '7916279'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '78.54' where entryId = '9340837'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0.34' where entryId = '9753338'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '19.39' where entryId = '10222734'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '76.51' where entryId = '10227476'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '16.67' where entryId = '11066617'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '11115502'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '15.6' where entryId = '11178985'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '26.47' where entryId = '12405961'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '78.72' where entryId = '12539282'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '83.77' where entryId = '12811085'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '170.84' where entryId = '13020746'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '32.04' where entryId = '13443157'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '78.97' where entryId = '13988489'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '38.37' where entryId = '14319742'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '20.26' where entryId = '14326433'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '55.4' where entryId = '14378622'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '33.01' where entryId = '14381402'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '137.13' where entryId = '14676577'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0.13' where entryId = '14871899'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '13.27' where entryId = '15257498'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '51.73' where entryId = '15418675'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '1.07' where entryId = '15632430'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '33.01' where entryId = '15803817'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '1.2' where entryId = '15815845'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '39.61' where entryId = '15971835'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0.08' where entryId = '16028576'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '1.3' where entryId = '16080148'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '230.64' where entryId = '16192300'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '56.79' where entryId = '16362177'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '2.01' where entryId = '16582968'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '2.1' where entryId = '16666236'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '5.56' where entryId = '16762427'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '2.49' where entryId = '16834489'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '1.25' where entryId = '16866364'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '55.1' where entryId = '16869094'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '51.46' where entryId = '16918678'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0.3' where entryId = '16937832'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '16950462'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '39.35' where entryId = '17009746'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0.73' where entryId = '17014367'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '1.44' where entryId = '17158033'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '246.06' where entryId = '17191124'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '36.91' where entryId = '17194772'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '17772855'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '35.33' where entryId = '18037387'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '27.47' where entryId = '18108692'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '32.2' where entryId = '18170740'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '8.07' where entryId = '18180500'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '6.02' where entryId = '18183934'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '3.61' where entryId = '18297588'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '63.56' where entryId = '18401533'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '50.49' where entryId = '18493876'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0.85' where entryId = '18563915'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '18657847'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '208.29' where entryId = '18695505'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '39.16' where entryId = '18756971'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '2.84' where entryId = '18809977'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '1.26' where entryId = '19052320'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '13.09' where entryId = '19116756'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '3.14' where entryId = '19263743'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '50.25' where entryId = '19824209'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '54.89' where entryId = '19982904'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '1118.97' where entryId = '20167547'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '20890095'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '45.98' where entryId = '21466198'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '25.82' where entryId = '21523537'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '2.07' where entryId = '23167675'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0.05' where entryId = '24138009'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '24519213'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '24928171'
update current13Fpositions set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' , percentOut = '0' where entryId = '26219134'
End Function

Retrive Rows from Table:
select * from archive13F where cusip = '040049108'
Number of Rows :3

update archive13F set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' where entryId = '80930249'
update archive13F set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' where entryId = '83636517'
update archive13F set compid = '131400', sectorNum = '901001', sectorDes = 'Independent Oil & Gas', issuerCik = '0001123871' where entryId = '85746939'
End Function
The Script is complete, exiting....