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: : 131316
SELECT companies.* , sectors.level3des
FROM companies, sectors
WHERE companies.sector = sectors.level3num and compid = '131316'
The Shares Amount is 105190000
The cusip is 713755106
NOT OLD
Retrive Rows from Table:
select * from current13Fpositions where cusip = '713755106'
Number of Rows :49
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '1367163'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '21.39'
where entryId = '1570122'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '8.38'
where entryId = '1701297'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '1827972'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '9.62'
where entryId = '2420568'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '5.05'
where entryId = '2828047'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '2.15'
where entryId = '2832847'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '3133903'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '3190658'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.74'
where entryId = '3506473'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '13.17'
where entryId = '3682815'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '4.05'
where entryId = '3732475'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '67.94'
where entryId = '3917473'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.21'
where entryId = '5086936'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '5576839'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '60.53'
where entryId = '7530154'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '9.06'
where entryId = '9342117'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '1.3'
where entryId = '9756534'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '69.36'
where entryId = '10245659'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '10.83'
where entryId = '11103490'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '44.49'
where entryId = '11275257'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '3.73'
where entryId = '11449978'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '12192458'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.07'
where entryId = '12319915'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '12327357'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '40.66'
where entryId = '12418211'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '12562502'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.04'
where entryId = '12629416'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.14'
where entryId = '12710046'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.75'
where entryId = '12987306'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.25'
where entryId = '13024617'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '1.26'
where entryId = '13468157'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '13671614'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '13678674'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '44.74'
where entryId = '13885509'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.11'
where entryId = '13907809'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '43.06'
where entryId = '13917327'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.07'
where entryId = '13939173'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.14'
where entryId = '14074172'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '45.91'
where entryId = '14233802'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '2.02'
where entryId = '14328112'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '30.39'
where entryId = '14330744'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '3.74'
where entryId = '14333008'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '1.26'
where entryId = '14661682'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.25'
where entryId = '14679735'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0'
where entryId = '14826101'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.24'
where entryId = '14877100'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '2.79'
where entryId = '14952129'
update current13Fpositions set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254' ,
percentOut = '0.01'
where entryId = '130408340'
End Function
Retrive Rows from Table:
select * from archive13F where cusip = '713755106'
Number of Rows :7
update archive13F set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254'
where entryId = '3688247'
update archive13F set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254'
where entryId = '4402951'
update archive13F set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254'
where entryId = '64924081'
update archive13F set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254'
where entryId = '68464341'
update archive13F set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254'
where entryId = '70229396'
update archive13F set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254'
where entryId = '124893576'
update archive13F set
compid = '131316',
sectorNum = '107007',
sectorDes = 'Food Wholesale',
issuerCik = '0000908254'
where entryId = '127721955'
End Function
The Script is complete, exiting....