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: : 130862
SELECT companies.* , sectors.level3des
FROM companies, sectors
WHERE companies.sector = sectors.level3num and compid = '130862'
The Shares Amount is 59720000
The cusip is 458786100
NOT OLD
Retrive Rows from Table:
select * from current13Fpositions where cusip = '458786100'
Number of Rows :89
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '41.95'
where entryId = '3127875'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '9.65'
where entryId = '3505380'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '10.41'
where entryId = '3730178'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '2.31'
where entryId = '9341617'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.94'
where entryId = '9755272'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '33.16'
where entryId = '10238798'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '12.56'
where entryId = '11054944'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '11068247'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '11115722'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '35.76'
where entryId = '12116610'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.34'
where entryId = '12287479'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '25.44'
where entryId = '12410545'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '25.44'
where entryId = '12430299'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '195.45'
where entryId = '12447545'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '12.56'
where entryId = '12910786'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '190.84'
where entryId = '13020893'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '13817939'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '53.3'
where entryId = '13825698'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '53.3'
where entryId = '13871309'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '13898018'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '9.24'
where entryId = '13938387'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '152.33'
where entryId = '13999159'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '7.5'
where entryId = '14327503'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '12.56'
where entryId = '14628740'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.79'
where entryId = '14875047'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '41.33'
where entryId = '15062404'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.01'
where entryId = '15258747'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '162.37'
where entryId = '15289607'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '63.63'
where entryId = '15323016'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '12.56'
where entryId = '16060682'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '40.96'
where entryId = '16543826'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '179.55'
where entryId = '16705645'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '6.69'
where entryId = '16763694'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '16955047'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '17000981'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.82'
where entryId = '17015451'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '12.56'
where entryId = '17482970'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '17776286'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '17787483'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '36.06'
where entryId = '18051275'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '176.99'
where entryId = '18380863'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '12.56'
where entryId = '18818886'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '144.56'
where entryId = '19746603'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '4.19'
where entryId = '19987628'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '2.51'
where entryId = '19987737'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '1.67'
where entryId = '19987992'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '8.84'
where entryId = '20128425'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '10.52'
where entryId = '20128552'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '18.7'
where entryId = '20128668'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '4.66'
where entryId = '20167144'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '1.84'
where entryId = '20168307'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.84'
where entryId = '23172511'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '23644417'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.1'
where entryId = '24138442'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '24520898'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '23.53'
where entryId = '24569681'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '24929037'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '31252992'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '446.72'
where entryId = '31774139'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '3.36'
where entryId = '31799486'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '5.79'
where entryId = '32908025'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '2.89'
where entryId = '33587881'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.17'
where entryId = '36744869'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '41123355'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '4.77'
where entryId = '41651409'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '3.01'
where entryId = '41674757'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '42058902'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '125.65'
where entryId = '42078463'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '17.65'
where entryId = '42106226'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '395.24'
where entryId = '42108249'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '2.19'
where entryId = '42114831'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '6.86'
where entryId = '42146074'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '3.33'
where entryId = '42158289'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '12.71'
where entryId = '42170333'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '23.02'
where entryId = '42171916'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '13.4'
where entryId = '42175840'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.33'
where entryId = '42181529'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '1.26'
where entryId = '42185873'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.01'
where entryId = '42198329'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.33'
where entryId = '42201433'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '3.67'
where entryId = '42222125'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '8.16'
where entryId = '42224910'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '989.18'
where entryId = '42231973'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '152.16'
where entryId = '42244768'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '181.04'
where entryId = '42251360'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '42457188'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '42466726'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0'
where entryId = '42468581'
update current13Fpositions set
compid = '130862',
sectorNum = '504001',
sectorDes = 'Diversified Machinery',
issuerCik = '0001044590' ,
percentOut = '0.57'
where entryId = '43978886'
End Function
Retrive Rows from Table:
select * from archive13F where cusip = '458786100'
Number of Rows :0
End Function
The Script is complete, exiting....