The following lines contain the word 'select', 'insert', 'update' or 'delete':
to a given address format. Line breaks are inserted in order for the
segments to be allocated inside the given box dimension.
If the box size is not big enough to contain all the required
segment together with segment joint characters(spaces/commas),
or the box width is not long enough to contain any segment,
then the function truncates the string to provide the possible output.
REQUIRES
address_style : address format style
address1 : address line 1
address2 : address line 2
address3 : address line 3
address4 : address line 4
city : name of city
county : name of county
state : name of state
province : name of province
postal_code : postal code
territory_short_name : territory short name
OPTIONAL REQUIRES
country_code : country code
customer_name : customer name
first_name : contact first name
last_name : contact last name
mail_stop : mailing informatioin
default_country_code : default country code
default_country_desc : default territory short name
print_home_country_flag : flag to control home county printing
print_default_attn_flag : flag to control default attention message
width NUMBER : address box width
height_min : address box minimum height
height_max : address box maximum height
RETURN
formatted address string
+--------------------------------------------------------------------*/
FUNCTION format_address( address_style IN VARCHAR2,
address1 IN VARCHAR2,
address2 IN VARCHAR2,
address3 IN VARCHAR2,
address4 IN VARCHAR2,
city IN VARCHAR2,
county IN VARCHAR2,
state IN VARCHAR2,
province IN VARCHAR2,
postal_code IN VARCHAR2,
territory_short_name IN VARCHAR2,
country_code IN VARCHAR2 default NULL,
customer_name IN VARCHAR2 default NULL,
first_name IN VARCHAR2 default NULL,
last_name IN VARCHAR2 default NULL,
mail_stop IN VARCHAR2 default NULL,
default_country_code IN VARCHAR2 default NULL,
default_country_desc IN VARCHAR2 default NULL,
print_home_country_flag IN VARCHAR2 default 'Y',
print_default_attn_flag IN VARCHAR2 default 'N',
width IN NUMBER default 1000,
height_min IN NUMBER default 1,
height_max IN NUMBER default 1
)return VARCHAR2 IS
BEGIN
return( ozfx_format_address( address_style,
address1,
address2,
address3,
address4,
city,
county,
state,
province,
postal_code,
territory_short_name ) );
SELECT
loc.address_style, loc.address1, loc.address2, loc.address3, loc.address4, loc.city,
loc.county, loc.state, loc.province, loc.postal_code, terr.territory_short_name
FROM
hz_locations loc,
fnd_territories_vl terr
WHERE
loc.location_id = c_location_id
AND loc.country = terr.territory_code(+);
SELECT
hzps.location_id location_id
FROM
hz_cust_site_uses_all hzcsu,
hz_cust_acct_sites_all hzcas,
hz_party_sites hzps
WHERE
hzcsu.site_use_id = p_site_use_id
AND hzcsu.cust_acct_site_id = hzcas.cust_acct_site_id
AND hzcas.party_site_id = hzps.party_site_id;
SELECT hz.party_name||' '||hzcsu.location into x_party_name
FROM hz_parties hz,
hz_cust_site_uses_all hzcsu
WHERE hzcsu.site_use_id = p_site_use_id
AND hz.party_id = p_party_id;
SELECT hz.party_name into x_party_name
FROM hz_parties hz
WHERE hz.party_id = p_party_id;
SELECT hzcsu.location into x_location
FROM hz_cust_site_uses_all hzcsu
WHERE hzcsu.site_use_id = p_site_use_id;