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: : 133057
SELECT companies.* , sectors.level3des
FROM companies, sectors
WHERE companies.sector = sectors.level3num and compid = '133057'
The Shares Amount is 375877000
The cusip is 122014103
NOT OLD
Retrive Rows from Table:
select * from current13Fpositions where cusip = '122014103'
Number of Rows :43
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '3.16'
where entryId = '186481'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.55'
where entryId = '1080945'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.5'
where entryId = '1141366'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.09'
where entryId = '1144807'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '2.1'
where entryId = '1223551'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '2.85'
where entryId = '1264252'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.09'
where entryId = '1271929'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '1357123'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '1367472'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '1.05'
where entryId = '1375162'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.09'
where entryId = '1378509'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '1599381'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.18'
where entryId = '1741332'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.29'
where entryId = '1783060'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.01'
where entryId = '1827182'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.13'
where entryId = '1983396'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '1.72'
where entryId = '2195104'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '3.38'
where entryId = '2374284'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '126.63'
where entryId = '2608155'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '4.54'
where entryId = '2827493'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '1.27'
where entryId = '2831055'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.73'
where entryId = '2883005'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.3'
where entryId = '3032759'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.2'
where entryId = '3273418'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '4.14'
where entryId = '3503787'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '3596504'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '3685638'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '3746725'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '4073697'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '4076169'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '4077203'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0'
where entryId = '4428234'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.11'
where entryId = '11271917'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.01'
where entryId = '13625885'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.01'
where entryId = '13626205'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.01'
where entryId = '13626607'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.01'
where entryId = '13627033'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.01'
where entryId = '13627432'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.23'
where entryId = '16680748'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '1.72'
where entryId = '16681006'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.98'
where entryId = '16681231'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.23'
where entryId = '16681439'
update current13Fpositions set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320' ,
percentOut = '0.12'
where entryId = '24144567'
End Function
Retrive Rows from Table:
select * from archive13F where cusip = '122014103'
Number of Rows :5
update archive13F set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320'
where entryId = '3688173'
update archive13F set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320'
where entryId = '4402987'
update archive13F set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320'
where entryId = '93510353'
update archive13F set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320'
where entryId = '94410251'
update archive13F set
compid = '133057',
sectorNum = '901001',
sectorDes = 'Independent Oil & Gas',
issuerCik = '0000833320'
where entryId = '40860666'
End Function
The Script is complete, exiting....