The following lines contain the word 'select', 'insert', 'update' or 'delete':
Description: builds the outer select clause
---------------------------------------------------*/
FUNCTION get_trd_sel_clause (p_view_by_dim IN VARCHAR2)
RETURN VARCHAR2
IS
l_sel_clause varchar2(7500);
'SELECT
' || ' cal.name VIEWBY,
nvl(p_freight_cost,0) ISC_MEASURE_9,
nvl(c_freight_cost,0) ISC_MEASURE_1,
' || isc_dbi_sutil_pkg.change_str (
p_new_numerator => 'c_freight_cost',
p_old_numerator => 'p_freight_cost',
p_denominator => 'p_freight_cost',
p_measure_name => 'ISC_MEASURE_2') || ', -- Rated Fr Cost Change
nvl(p_freight_weight,0) ISC_MEASURE_10,
nvl(c_freight_weight,0) ISC_MEASURE_4,
' || isc_dbi_sutil_pkg.change_str (
p_new_numerator => 'c_freight_weight',
p_old_numerator => 'p_freight_weight',
p_denominator => 'p_freight_weight',
p_measure_name => 'ISC_MEASURE_5') || ', -- Rated Fr Weight Change
' || isc_dbi_sutil_pkg.rate_str (
p_numerator => 'p_freight_cost',
p_denominator => 'p_freight_weight',
p_rate_type => 'RATIO',
p_measure_name => 'ISC_MEASURE_11') || ', -- Fr Cost per Weight Prior
' || isc_dbi_sutil_pkg.rate_str (
p_numerator => 'c_freight_cost',
p_denominator => 'c_freight_weight',
p_rate_type => 'RATIO',
p_measure_name => 'ISC_MEASURE_7') || ', -- Fr Cost per Weight
' || isc_dbi_sutil_pkg.change_rate_str (
p_new_numerator => 'c_freight_cost',
p_new_denominator => 'c_freight_weight',
p_old_numerator => 'p_freight_cost',
p_old_denominator => 'p_freight_weight',
p_rate_type => 'RATIO',
p_measure_name => 'ISC_MEASURE_8'); -- Fr Cost per Weight Change