2057: l_max_left_length NUMBER; -- Length to the left of the decimal point
2058: l_max_right_length NUMBER; -- Length to the right of the decimal point
2059: l_left_length NUMBER;
2060: l_right_length NUMBER;
2061: l_attribute_id pv_search_attr_values.attribute_id%TYPE;
2062: l_format_string VARCHAR2(300);
2063: l_positive_format_string VARCHAR2(300);
2064: --l_any_negative BOOLEAN := FALSE;
2065: l_prev_party_id NUMBER;
2091: -- the partners in the list (x_partner_tbl).
2092: --
2093: -- The outer join to hz_parties is to trick the query so that NULL values
2094: -- are returned for partners that don't have a corresponding record in
2095: -- pv_search_attr_values.
2096: -- ---------------------------------------------------------------------
2097: /*
2098: CURSOR lc_attr_values IS
2099: SELECT b.party_id,
2097: /*
2098: CURSOR lc_attr_values IS
2099: SELECT b.party_id,
2100: DECODE(a.attr_text, NULL, TO_CHAR(a.attr_value), a.attr_text) attribute_value
2101: FROM pv_search_attr_values a,
2102: hz_parties b
2103: WHERE a.party_id (+) = b.party_id AND
2104: a.attribute_id (+) = l_attribute_id AND
2105: b.party_id IN (
2122: ' SELECT /*+ leading(c) */ ' ||
2123: ' b.party_id, ' ||
2124: ' DECODE(a.attr_text, NULL, TO_CHAR(a.attr_value), a.attr_text) attribute_value, ' ||
2125: ' c.idx ' ||
2126: ' FROM pv_search_attr_values a, ' ||
2127: ' hz_parties b, ' ||
2128: ' (SELECT * ' ||
2129: ' FROM (SELECT rownum idx, column_value party_id ' ||
2130: ' FROM (SELECT column_value ' ||
2142: -- SELECT /*+ leading(c) */
2143: /* b.party_id,
2144: DECODE(a.attr_text, NULL, TO_CHAR(a.attr_value), a.attr_text) attribute_value,
2145: c.idx
2146: FROM pv_search_attr_values a,
2147: hz_parties b,
2148: (SELECT *
2149: FROM (SELECT rownum idx, column_value party_id
2150: FROM (SELECT column_value