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: : 131029
SELECT companies.* , sectors.level3des
FROM companies, sectors
WHERE companies.sector = sectors.level3num and compid = '131029'
The Shares Amount is 25400000
The cusip is 03937R102
NOT OLD
Retrive Rows from Table:
select * from current13Fpositions where cusip = '03937R102'
Number of Rows :70
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.15'
where entryId = '1827080'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '2452809'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '3685650'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '11.24'
where entryId = '3726240'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '12.21'
where entryId = '4112979'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.2'
where entryId = '5086613'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '8.34'
where entryId = '9340832'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '3.58'
where entryId = '9753330'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '256.61'
where entryId = '10227416'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.05'
where entryId = '10756241'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '46.37'
where entryId = '11102667'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '1.03'
where entryId = '11194708'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '60.65'
where entryId = '11449051'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '12192512'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '70.09'
where entryId = '12228345'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.28'
where entryId = '12286253'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '12327012'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '12562467'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '14.61'
where entryId = '12626935'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '8.34'
where entryId = '12986767'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.02'
where entryId = '13022124'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '6.32'
where entryId = '13242342'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '1.07'
where entryId = '13451014'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.86'
where entryId = '13468564'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '13671663'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '13678322'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.42'
where entryId = '13900056'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '18.44'
where entryId = '13932184'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.67'
where entryId = '14106394'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '6.31'
where entryId = '14309642'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '5.77'
where entryId = '14326427'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '4.23'
where entryId = '14332424'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.86'
where entryId = '14660762'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.02'
where entryId = '14677286'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '14821451'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '4.41'
where entryId = '14871879'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '43.06'
where entryId = '15070075'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '4.61'
where entryId = '15070997'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '4.61'
where entryId = '15084960'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '15132640'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '15262092'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '5.01'
where entryId = '15449246'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.32'
where entryId = '16116965'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.02'
where entryId = '16193498'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '6.97'
where entryId = '16352615'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '6.97'
where entryId = '16353869'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '16615451'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '4.95'
where entryId = '16834485'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.04'
where entryId = '16937962'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.78'
where entryId = '17014360'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '144.75'
where entryId = '17194743'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '42.31'
where entryId = '17210557'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '17532992'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.32'
where entryId = '17540216'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '17670436'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '8.18'
where entryId = '17727452'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.02'
where entryId = '17977162'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.63'
where entryId = '18035034'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '18047001'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '42.22'
where entryId = '18183932'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '5.16'
where entryId = '18297584'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '9.12'
where entryId = '18492716'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.31'
where entryId = '19115168'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.02'
where entryId = '19146938'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '2.92'
where entryId = '23167648'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0'
where entryId = '24519205'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '0.05'
where entryId = '30017611'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '4.23'
where entryId = '31798708'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '4.63'
where entryId = '31890756'
update current13Fpositions set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343' ,
percentOut = '6.75'
where entryId = '32907361'
End Function
Retrive Rows from Table:
select * from archive13F where cusip = '03937R102'
Number of Rows :3
update archive13F set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343'
where entryId = '85415695'
update archive13F set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343'
where entryId = '86775770'
update archive13F set
compid = '131029',
sectorNum = '701004',
sectorDes = 'Synthetics',
issuerCik = '0001072343'
where entryId = '88929693'
End Function
The Script is complete, exiting....