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: : 130534
SELECT companies.* , sectors.level3des
FROM companies, sectors
WHERE companies.sector = sectors.level3num and compid = '130534'
The Shares Amount is 22813000
The cusip is 713831105
NOT OLD
Retrive Rows from Table:
select * from current13Fpositions where cusip = '713831105'
Number of Rows :69
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '18.27'
where entryId = '3732479'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '32.88'
where entryId = '7430196'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '1.17'
where entryId = '9756536'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '144.61'
where entryId = '10245671'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '10.83'
where entryId = '10835295'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '4.62'
where entryId = '11449979'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '12327358'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0.05'
where entryId = '12987307'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '45.41'
where entryId = '13020986'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0.19'
where entryId = '13468158'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '13678675'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '13818377'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '27.41'
where entryId = '13902757'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '32.42'
where entryId = '14328113'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0.19'
where entryId = '14661683'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '44.55'
where entryId = '14676813'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '14826103'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '7.09'
where entryId = '14877102'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '17.13'
where entryId = '15246359'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '15262447'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '50.59'
where entryId = '15321176'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '5.68'
where entryId = '15450339'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0.07'
where entryId = '16117882'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '20.25'
where entryId = '16192533'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '8.72'
where entryId = '16393329'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '16615816'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '5.6'
where entryId = '16835573'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '16955352'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '17001066'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0.77'
where entryId = '17016079'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '30.51'
where entryId = '17191346'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '4.82'
where entryId = '17275755'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0.01'
where entryId = '17526298'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0.07'
where entryId = '17541156'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '17776354'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '17786714'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '71.76'
where entryId = '18054207'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '5.9'
where entryId = '18298682'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '40.69'
where entryId = '18695717'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '25.91'
where entryId = '19068418'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0.15'
where entryId = '19116101'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '10.34'
where entryId = '19684759'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '10.34'
where entryId = '19697824'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '65.78'
where entryId = '21466582'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '23406566'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '24521873'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '306.15'
where entryId = '24569758'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '9.08'
where entryId = '26256604'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '10.27'
where entryId = '29957039'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '4.64'
where entryId = '31799953'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '7.39'
where entryId = '32908397'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '34254628'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '24.19'
where entryId = '40851752'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '5.33'
where entryId = '41651931'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '29.81'
where entryId = '42090946'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '17.52'
where entryId = '42106887'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '7.04'
where entryId = '42146601'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '2.09'
where entryId = '42158672'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '20.82'
where entryId = '42169999'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '44.84'
where entryId = '42172272'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '66.05'
where entryId = '42175001'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '30.68'
where entryId = '42175959'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '630.93'
where entryId = '42215686'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '9.74'
where entryId = '42225515'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '42467498'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '0'
where entryId = '42470758'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '48.8'
where entryId = '50844244'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '3.29'
where entryId = '51214806'
update current13Fpositions set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426' ,
percentOut = '1.86'
where entryId = '57841892'
End Function
Retrive Rows from Table:
select * from archive13F where cusip = '713831105'
Number of Rows :2
update archive13F set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426'
where entryId = '51038047'
update archive13F set
compid = '130534',
sectorNum = '601005',
sectorDes = 'Networking & Communication Devices',
issuerCik = '0001001426'
where entryId = '96633584'
End Function
The Script is complete, exiting....