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: : 130727
SELECT companies.* , sectors.level3des
FROM companies, sectors
WHERE companies.sector = sectors.level3num and compid = '130727'
The Shares Amount is 87827000
The cusip is 456607100
NOT OLD
Retrive Rows from Table:
select * from current13Fpositions where cusip = '456607100'
Number of Rows :58
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '8.79'
where entryId = '1276950'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '8.03'
where entryId = '1701185'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '11.39'
where entryId = '1728269'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '1827619'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0.57'
where entryId = '2827804'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0.03'
where entryId = '2832072'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '64.68'
where entryId = '3031519'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '28.75'
where entryId = '3127871'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '1.65'
where entryId = '3302173'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '1.21'
where entryId = '3505349'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '8.81'
where entryId = '3682658'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '7.95'
where entryId = '3730051'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '22.65'
where entryId = '3919101'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '5580281'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '2.38'
where entryId = '6227907'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '18.33'
where entryId = '7529881'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '9169455'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '2.01'
where entryId = '9341599'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '5.12'
where entryId = '9755221'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '221.89'
where entryId = '10238486'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '1.54'
where entryId = '10683548'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '6.26'
where entryId = '10984476'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '42.51'
where entryId = '11103176'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '11115715'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '1.41'
where entryId = '11265287'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '35.63'
where entryId = '11350097'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '11.39'
where entryId = '11365033'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '1.75'
where entryId = '11420986'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '3.4'
where entryId = '11449614'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '56.93'
where entryId = '11674266'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '11986202'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0.02'
where entryId = '12319082'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '12326260'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '12424053'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '11.39'
where entryId = '12464503'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0.02'
where entryId = '12934409'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '1.25'
where entryId = '13243915'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '2.44'
where entryId = '13467885'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0.53'
where entryId = '13669096'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '13677575'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '13817932'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0.02'
where entryId = '13938357'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '17.4'
where entryId = '14327472'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '11.39'
where entryId = '14363384'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '14458060'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '14552663'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '2.73'
where entryId = '14661323'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '1.25'
where entryId = '14870319'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '114.18'
where entryId = '14874962'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0.02'
where entryId = '15258713'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '11.39'
where entryId = '15616687'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '16286105'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '3.42'
where entryId = '17005499'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '11.39'
where entryId = '17100753'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '17672698'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '18750286'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '2.69'
where entryId = '38299537'
update current13Fpositions set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468' ,
percentOut = '0'
where entryId = '130459678'
End Function
Retrive Rows from Table:
select * from archive13F where cusip = '456607100'
Number of Rows :25
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '3847104'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '71183938'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '73743353'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '77781100'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '79945317'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '81762084'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '83866791'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '86102376'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '87803385'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '90134756'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '92204773'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '94253851'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '96028413'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '98417304'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '100989330'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '103549762'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '105764515'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '109068172'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '111855444'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '114286936'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '116760929'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '119646050'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '122410082'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '124954880'
update archive13F set
compid = '130727',
sectorNum = '301010',
sectorDes = 'Savings & Loans',
issuerCik = '0000773468'
where entryId = '127816028'
End Function
The Script is complete, exiting....