-- --------------------------------------------------------------------------------
-- Routine DDL
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `getCompanyOverviewV4`(
IN iCk INT(10) ZEROFILL
)
BEGIN
CREATE TEMPORARY TABLE IF NOT EXISTS filingIDTT (
filingID INT
);
INSERT INTO filingIDTT (filingID)
SELECT filingID
FROM aggr_filings
WHERE cik_issuer = iCIK;
SELECT *
FROM aggr_filings
WHERE filingID IN (SELECT filingID FROM filingIDTT);
SELECT *
FROM aggr_transactions
WHERE filingID IN (SELECT filingID FROM filingIDTT);
SELECT *
FROM ceostockwatch.aggr_owners
WHERE filingID IN (SELECT filingID FROM filingIDTT);
DROP TEMPORARY TABLE filingIDTT;
END
|