Sequence Generator UDF for Teradata