Just a slight issue:
I'm building ranges of dates via the (really helpful!) sa_rowgenerator system procedure and left-join them to other dates. This works great. However, sometimes the procedure should return no rows.
I would expect it to do that when both its rstart and rend arguments are NULL. However
does return one single row with row_num = 0.
While I can certainly restrict the output in that cases with a WHERE clause (or could explicitly use a rstart value > rend value or a NULL as rstep value to get an empty result set), I do not really understand the procedure's behaviour here.
Just for comparison: If I omit the first and/or second parameter, they are set to their default values (0 resp. 100) as expected. So an explicit NULL value is not treated as default value, again as expected.
Does the procedure treat NULL = NULL and therefore count that as one initial step?
(As stated, I'm not really asking for a solution but wanted to share another pitfall I've found...)
I had a look at the code and this procedure treats NULL as 0 which is perhaps not the best behavior ... and I would not recommend that you rely on this behaviour since it could change in the future.
sa_rowgenerator() will currently return no rows iff