T-Stats 2.0 upgrade errors


Hi All,

Good day.

we are upgrading our t-stats from v1.0 to v2.0

when I run the scripts , we have some errors from null_value field in LTRX_TS_ELEMENT_DIVISION.

exec lp_ts_update_division_elements

they came from ltr_ts_element table  id in(10,13,23,24),

then I tried to skip this step, because it only updates LTRX_TS_ELEMENT_DIVISION

 

 

but it came back  when I tried to run Audit Data Load Sample.sql
I checked the code, it was sp load_customers causing the errors. it was doing the same thing what sp lp_ts_update_division_elements done before.

 

so I think I have to ask for help.

 

=========================

IF @mode='I' GOTO Result_Set -- don't want to change the criteria for incremental load, otherwise all data won't be consistent

-- Make sure that each Cube has all of the elements assigned to it
--IF @create_table in ('N','U','A')
BEGIN --3
insert into  [production tessitura server].impresario.dbo.LTRX_TS_ELEMENT_DIVISION
(element_id,division,data_select,data_from,data_where,null_value)
select   e.id,
c.id,
default_select,
default_from,
default_where,
ISNULL((SELECT CAST(MIN(id) AS VARCHAR(255)) FROM [production tessitura server].impresario.dbo.LTRX_TS_DIVISION_RANGE WHERE division = c.id and range_type = e.range_type), default_def)
from [production tessitura server].impresario.dbo.LTR_TS_ELEMENT e
cross join [production tessitura server].impresario.dbo.LTR_TS_DIVISION c
where not exists (select * from [production tessitura server].impresario.dbo.LTRX_TS_ELEMENT_DIVISION where e.id=element_id and c.id=division)

update a
set a.null_value =
(select min(id) from [production tessitura server].impresario.dbo.ltrx_ts_division_range wd
where wd.division=a.division
and wd.range_type=b.range_type
and 0 between wd.start_value and wd.end_value)
from [production tessitura server].impresario.dbo.LTRX_TS_ELEMENT_DIVISION a
join [production tessitura server].impresario.dbo.ltr_ts_element b on a.element_id=b.id
where isnull(b.range_type,0)<>0
END -- 3

=================

I can put a isnull(selection, 0) to that value, but that is not a right thing to do.

So thank you very much for your help.

have fun

Ben



[edited by: Ben Gu at 1:07 AM (GMT -6) on 28 Apr 2010]