Document toolboxDocument toolbox

Functions (SQLServer Only)

FUNCTION GetAllContainedRegions (@regionId sql_variant)

RETURNS @regions TABLE (region_no int, region_level int)

@regions contains those regions that are mapped to the FRU and any parent region; together with all child regions belonging to these parent regions. 


FUNCTION GetMappedContainedRegions (@regionId sql_variant)

RETURNS @regions TABLE (region_no int, region_level int)

@regions contains those regions that are mapped to the FRU and any parent region. 


FUNCTION SP_EFF_DATE (@now datetime)

RETURNS datetime

Returns the date now if sp083.eff_date is NULL or the effective date if sp083.eff_date is defined. The returned date is also set according to the rules for sp083.eff_base_time, and sp083.eff_time. 


FUNCTION to_date(@theDate varchar(30), @formatHint varchar(30))

RETURNS datetime

This is a cut down version of Oracle's to_date function supporting the date format 'DD/MM/YYYY' or DD/MM/YYYY HH24:MI' however, SQL Server date conversion is also applied, and so other formats may also work. But these additional formats are not supported. 


FUNCTION trunc(@toTrunc datetime)

RETURNS datetime

This provides the same functionality as the Oracle trunc function when the parameter specified is a date. Only a DAY resolution is supported