Search Results days_between




Overview

FFFUNC is a public PL/SQL package owned by APPS in the Oracle E-Business Suite, delivered under the Oracle Corporation (UK) Ltd copyright of 1993. Its documented purpose is to centralize all functions that are called by Oracle Fast Formula (FF) yet are not intrinsic PL/SQL built-ins, so that formulas can invoke them as external functions rather than through user-defined functions. This design keeps formula text concise and portable across the ETRM/FF engine.

The package header (fffunc.pkh, version 115.6, dated 11-JUL-2002) carries the pragma RESTRICT_REFS setting for WNDS, WNPS, and RNDS, which makes the conversion functions callable from SQL alongside PL/SQL. Over its release history it accumulated native and short-name conversion routines and, with release 11-JUL-2002, a translated-message handler (gfm). In Oracle EBS 12.1.1 and 12.2.2 the package remains classified as API type OTHER, is referenced by 23 other packages, and supports formula-driven payroll, compensation, and benefits calculations that require date, numeric, and text manipulation.

Key Procedures and Functions

The 13 documented routines fall into conversion, date arithmetic, and text utility categories:

  • NC – Number to Character; converts a number to a string in canonical format. Short name keeps formula text brief.
  • CN – Character to Number; performs the reverse canonical conversion.
  • DC – Date to Char; returns a date string in canonical format.
  • CD – Char to Date; converts a canonical string back to a date.
  • DATE_TO_CHAR – Descriptive alias that calls DC.
  • TEXT_TO_DATE – Descriptive counterpart to the text/date conversion family.
  • TN – Text-to-number utility added in the same 1999 change as TD and DC.
  • TD – Text-to-date utility, paired with TN.
  • ROUND_UP – Special rounding function for numeric formula results.
  • ADD_DAYS – Adds a day interval to a date for formula date arithmetic.
  • ADD_YEARS – Adds a year interval to a date for service-date and anniversary calculations.
  • DAYS_BETWEEN – Returns the number of days separating two dates; this is the routine most commonly queried in formula troubleshooting.
  • GFM – Translated message handler added 11-JUL-2002, so formulas can emit language-specific messages.

Tables Accessed

The documented metadata records no tables referenced through APPS synonyms. FFFUNC is a pure utility package: its functions operate on scalar IN parameters (numbers, dates, and strings) and return scalar values without reading or writing database tables. Translated message handling in GFM relies on message infrastructure rather than direct table access by the package itself. This stateless character is central to why the RESTRICT_REFERENCES pragmas can be declared and why the functions are safe for SQL invocation.

Usage Notes

FFFUNC is normally invoked indirectly. Oracle Fast Formula compilations resolve external function names against this package, so payroll, benefits, and compensation formulas call NC, DC, ADD_DAYS, DAYS_BETWEEN, and their peers without the formula author referencing the package directly. Because the same routines are callable from SQL, developers may also embed them in views, reports, or custom concurrent programs where canonical date/number formatting is required.

Custom code should call FFFUNC rather than duplicating conversion logic, since the canonical formats and rounding behavior are the reference implementation used throughout the formula engine. When Oracle patches the package, the private body can change while the documented function signatures remain stable, so dependent formulas and the 23 referencing packages continue to compile. Use DAYS_BETWEEN for duration arithmetic, ADD_DAYS and ADD_YEARS for offset calculations, and the NC/DC/CN/CD pair for presentation-safe conversions.