i need idea or way check if schedule jobs work , insert right data. have function call stored procedure count inserted data today , insert specific field.
like
set @male = (select count(iduser) (select iduser #tmplog2 sex = 1 , cast(catchtime date) = @date group iduser)u); set @female = (select count(iduser) (select iduser #tmplog2 sex = 0 , cast(catchtime date) = @date group iduser)u); insert catchlog ( [male], [female] ) values ( @male, @female )
the stored procedure works ok, sometime when today have lot of data, result inserted 0 male / female. it's possible have 0 data inserted when today data no male / female.
but sometime inserted 0 there male n female data. can me check, how check if data inserted true , give report or insert error log if data inserted not true?
sorry bad english
i dont know column using count() function. if using nullable column may gives 0 if record added column value null.
consider use primary key column or not nullable column in count() argument.
Comments
Post a Comment