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: : 130551
SELECT companies.* , sectors.level3des
FROM companies, sectors
WHERE companies.sector = sectors.level3num and compid = '130551'
The Shares Amount is 19247000
The cusip is 501803308
NOT OLD
Retrive Rows from Table:
select * from current13Fpositions where cusip = '501803308'
Number of Rows :73
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.1'
where entryId = '1827718'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.19'
where entryId = '2207735'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '3167975'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '8.05'
where entryId = '3682695'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '12.34'
where entryId = '3730755'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '23.74'
where entryId = '4113186'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '211.94'
where entryId = '4374287'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '7.07'
where entryId = '5218235'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '6271950'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '17.64'
where entryId = '9625569'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '3.23'
where entryId = '9755596'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '71.92'
where entryId = '10240377'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '118.25'
where entryId = '11103266'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '11153083'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '369.83'
where entryId = '11449723'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '12005255'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '12327259'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '12562597'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '4.59'
where entryId = '13023896'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '9.25'
where entryId = '13242798'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '13401907'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.53'
where entryId = '13467941'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '13678563'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '1.45'
where entryId = '13968540'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '8.31'
where entryId = '14310155'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '6.44'
where entryId = '14327655'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '445.73'
where entryId = '14378738'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.53'
where entryId = '14661424'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '4.92'
where entryId = '14679024'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.07'
where entryId = '14875603'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '14952408'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '15262343'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '4.92'
where entryId = '15450037'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '1.45'
where entryId = '15461211'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '10.6'
where entryId = '16110563'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.2'
where entryId = '16117623'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '7.44'
where entryId = '16195357'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '7.78'
where entryId = '16353192'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '7.78'
where entryId = '16354446'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '16615699'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '4.85'
where entryId = '16835236'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.42'
where entryId = '16938767'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '17226305'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '77.93'
where entryId = '17537971'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.2'
where entryId = '17540891'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '7.55'
where entryId = '17728001'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '17787560'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '17801761'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '584.48'
where entryId = '17966532'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '3.9'
where entryId = '17979003'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '18273911'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '5.07'
where entryId = '18298372'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.06'
where entryId = '18355822'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '18825013'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '19027063'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.49'
where entryId = '19115839'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '3.9'
where entryId = '19148761'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '9.26'
where entryId = '23173577'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '24521159'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '24927028'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '29961132'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '4.03'
where entryId = '31799615'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '6.34'
where entryId = '32908118'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.02'
where entryId = '35073972'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '4.68'
where entryId = '40853056'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '41123426'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '21.3'
where entryId = '42100967'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '24.88'
where entryId = '42171973'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0.01'
where entryId = '42233051'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '42467397'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '42470751'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '5.73'
where entryId = '42498457'
update current13Fpositions set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130' ,
percentOut = '0'
where entryId = '49517155'
End Function
Retrive Rows from Table:
select * from archive13F where cusip = '501803308'
Number of Rows :3
update archive13F set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130'
where entryId = '3847121'
update archive13F set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130'
where entryId = '16851160'
update archive13F set
compid = '130551',
sectorNum = '402008',
sectorDes = 'Medical Practitioners',
issuerCik = '0001003130'
where entryId = '89699507'
End Function
The Script is complete, exiting....