We are currently in the process of evaluating (POC) bright house as a datawarehouse tool and hold data large amount of data.
The database currently has around 150gb dat size. I have a stored procedure which requires a user to input few parameters and return the data from the various tables in the bright house database. The stored procedure was originally written in sybase. We are planning to move to use mysql environment and probably info bright for datawarehouse solution.
The problem i am having is that my stored procedure has local variables which i need to call to handle date input into specific format e.g.
Create procedure test
( startDate varchar(14),
endDate varchar(14),
UserId varchar(64),
corpId varchar(32),
group varchar(5),
subordinates varchar(5)
)
Begin
declare starttime datetime;
declare enddatetime datetime;
declare Region varchar(32);
set Region = ‘GLOBAL’;
set starttime = cast(concat(cast(startDate as char(10)), ’ 00:00:00’) as datetime);
set enddatetime = cast(concat(endDate char(10)), ’ 23:59:59’) as datetime);
CREATE temporary TABLE tt_exch
AS
select ExchangeCode,TSExchange,Region,
CAST(SUBSTRING(TimeZone,1,3) AS DECIMAL(3,1)) ‘TimeZone’,
TIMESTAMPADD(HOUR,-CAST(SUBSTRING(TimeZone,1,3) AS DECIMAL(3,1)),‘2008-01-01 00:00:00’) ‘StartTime’,
TIMESTAMPADD(HOUR,-CAST(SUBSTRING(TimeZone,1,3) AS DECIMAL(3,1)),‘2008-02-02 00:00:00’) ‘EndTime’
from gblExchange
where Region = IFNULL(Region,Region);
so therefore i need to ensure that users only input date format as 20081001 and my stored proc needs to be able to handle and convert this with times to get accurate results…an i wish to use the starttime from exch table created etc….
The bottom line is how can use local variables in info bright to ensure i get best optimization.
Also there are few temporary tables in my stored procedure. Does info bright support this? If not, How can i get around? I also have few if statements to convert the users input parameter into other format e.g If group= ‘Y’ then group = ‘True’ e.t.c
kind regards
Naresh
TradingScreen

