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: : 131011
SELECT companies.* , sectors.level3des
FROM companies, sectors
WHERE companies.sector = sectors.level3num and compid = '131011'
The Shares Amount is 16974000
The cusip is 33610T109
NOT OLD
Retrive Rows from Table:
select * from current13Fpositions where cusip = '33610T109'
Number of Rows :33
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '25.32'
where entryId = '3031458'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '65.74'
where entryId = '3682586'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '8.14'
where entryId = '3729021'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '22.39'
where entryId = '7429777'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '6.96'
where entryId = '9754694'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '7.93'
where entryId = '10223196'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '30.59'
where entryId = '10235488'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '14.58'
where entryId = '11181017'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '35.3'
where entryId = '12135045'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '13.2'
where entryId = '12574586'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '35.3'
where entryId = '13647794'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '13.2'
where entryId = '14216401'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '12.8'
where entryId = '14327159'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '0'
where entryId = '14823456'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '0.04'
where entryId = '14874109'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '1.41'
where entryId = '15071084'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '1.41'
where entryId = '15085047'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '29.07'
where entryId = '15216209'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '13.2'
where entryId = '15973616'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '29.07'
where entryId = '16548154'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '0'
where entryId = '16955026'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '13.2'
where entryId = '17011807'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '0.85'
where entryId = '17015115'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '23.57'
where entryId = '17275010'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '27.3'
where entryId = '18064167'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '13.2'
where entryId = '18374002'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '4.53'
where entryId = '21274213'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '0.35'
where entryId = '23171130'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '0'
where entryId = '24520386'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '32.34'
where entryId = '26966062'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '18.17'
where entryId = '42082212'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '0'
where entryId = '130459263'
update current13Fpositions set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912' ,
percentOut = '5.57'
where entryId = '132212631'
End Function
Retrive Rows from Table:
select * from archive13F where cusip = '33610T109'
Number of Rows :35
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '65381326'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '67543678'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '65586733'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '65858395'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '63713772'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '64076147'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '64203037'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '89536961'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '91487895'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '93525342'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '95471935'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '97269134'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '99776424'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '102353694'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '105275658'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '105764152'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '107801643'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '109067807'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '110520375'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '110349745'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '111855070'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '113247633'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '113526658'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '114286563'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '115597724'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '116760555'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '118251132'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '119645670'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '121198327'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '122409682'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '123785373'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '124954476'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '126297690'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '127815619'
update archive13F set
compid = '131011',
sectorNum = '301009',
sectorDes = 'Domestic Regional Banks',
issuerCik = '0001068912'
where entryId = '129280010'
End Function
The Script is complete, exiting....