Search Results recursive_replace




Overview

APPS.HR_JP_STANDARD_PKG is a Japanese localization utility package within Oracle E-Business Suite, owned by the APPS schema and classified as an OTHER API in ETRM. Its primary business function is to support Japanese-language data handling across the Human Resources and related product families, including character set conversion between hexadecimal representations and readable strings, full-width (zenkaku) and half-width (hankaku) character manipulation, Japanese kana case transformation, and date/number formatting. The package is built as an AUTHID CURRENT_USER package, meaning it executes with the privileges of the calling user, and it declares a local collection type (t_varchar2_tbl) used internally for indexing operations. Because it serves as a shared utility layer rather than a business transaction API, it is referenced by twelve other packages and by forms that require disciplined Japanese text processing.

Key Procedures and Functions

The package exposes 29 documented procedures and functions. Grouping them by purpose:

  • Hexadecimal and character set conversion: HEXTOCHAR, SJHEXTOCHAR, CHARTOHEX, and CHARTOSJHEX convert between hexadecimal encodings and character strings, with SJHEXTOCHAR and CHARTOSJHEX specialized for Shift-JIS handling. These are declared DETERMINISTIC.
  • Generic string transformation: TRANSLATE2, STRIP, and RECURSIVE_REPLACE perform character translation, character removal, and repeated substitution respectively.
  • Numeric and validation helpers: ROUND2 and IS_INTEGER provide numeric rounding and integer tests; IS_HANKAKU and IS_ZENKAKU test whether a string contains half-width or full-width characters.
  • Width conversion: TO_HANKAKU and TO_ZENKAKU — the latter is the object most commonly surfaced by searches for "to_hankaku" — convert strings between half-width and full-width forms, a frequent requirement for Japanese name, address, and code normalization.
  • Kana case handling: LOWER_KANA, UPPER_KANA, and UPPER_HANKAKU adjust kana and half-width character casing.
  • Table and index utilities: TO_TABLE and GET_INDEX_AT support the internal indexed collection type.
  • Japanese presentation helpers: TO_JP_CHAR and TO_JP_DATE render values into Japanese character and date formats.

Tables Accessed

The documented tables referenced through APPS synonyms are FND_APPLICATION, FND_NEW_MESSAGES, DUAL, PLITBLM, and UTL_RAW. FND_APPLICATION and FND_NEW_MESSAGES provide application identification and message lookup supporting localized message text; DUAL serves as the standard single-row query source for scalar evaluations; PLITBLM is the internal PL/SQL character-set and message utility table used during conversion; and UTL_RAW supplies raw-to-hexadecimal and hexadecimal-to-raw primitives underpinning the hex conversion functions.

Usage Notes

HR_JP_STANDARD_PKG is typically invoked from Japanese-localized Oracle Forms, from concurrent programs performing data load or conversion, and from custom PL/SQL code that must normalize or validate Japanese text before insert or update. Because the package is AUTHID CURRENT_USER, callers require appropriate execute grants, and calls should be qualified as APPS.HR_JP_STANDARD_PKG.TO_HANKAKU(...). Given its DETERMINISTIC declarations, the conversion functions are safe for use in repeated expression evaluation. Its heavy reuse across twelve dependent packages means modifications must be regression tested widely, particularly where half-width and full-width conversion affects keyed business data.