Search Results max_doctable_name_len




Overview

SYSTEM.WPG_DOCLOAD is the Oracle Applications document download package that underpins the PL/SQL Gateway's file delivery mechanism in Oracle E-Business Suite 12.1.1 and 12.2.2. It belongs to the SYSTEM schema and is classified as an OTHER API within the ETRM repository. Its primary business function is to allow a document stored in a database document table to be streamed to a client browser during an HTTP request handled by mod_plsql or the equivalent gateway component. Rather than returning an HTML page, a PL/SQL procedure invokes this package to signal the gateway that a binary or text file should be transmitted as the response body, together with the appropriate MIME type and content length headers.

The package also defines several public constants that constrain the document table schema. NAME_COL_LEN fixes the NAME column length at 64 characters, MIMET_COL_LEN fixes the MIME_TYPE column at 48 characters, and MAX_DOCTABLE_NAME_LEN limits document table names to 256 characters. The public type PARTS_TABLE is declared as a table of VARCHAR2(256) values indexed by BINARY_INTEGER.

Key Procedures and Functions

  • DOWNLOAD_FILE — The core signalling procedure. It is called from within a document download procedure to instruct the gateway that the named file is to be downloaded from the document table to the browser. Its p_bcaching parameter controls whether browser caching is honoured; when set to TRUE, the gateway ignores the client's If-Modified-Since header and transmits the document rather than returning a 302 redirect to a cached copy.
  • GET_DOWNLOAD_FILE — Retrieves a file entity for download from the underlying document storage.
  • GET_DOWNLOAD_BLOB — Handles download of a document stored as a BLOB.
  • GET_DOWNLOAD_BFILE — Handles download of a document stored as a BFILE.
  • IS_FILE_DOWNLOAD — Determines whether the current request is a file download, allowing gateway logic to branch accordingly.
  • GET_CONTENT_LENGTH — Returns the length of the content to be downloaded, enabling the gateway to emit a correct Content-Length header before the body is streamed. This is the object most commonly sought by developers debugging truncated or mis-sized downloads.

Tables Accessed

The ETRM metadata records references, through APPS synonyms, to DBMS_LOB, DBMS_SQL, OWA_UTIL, and DBMS_SYS_SQL. These are Oracle-supplied PL/SQL packages rather than application tables. DBMS_LOB performs the large-object reads that feed BLOB and BFILE downloads, DBMS_SQL and DBMS_SYS_SQL support dynamic SQL used to locate and read the document table entries, and OWA_UTIL supplies the HTTP header and output primitives required by the gateway. The package does not own or store application data itself; the actual document rows reside in the calling application's document table, whose name and column widths must conform to the constants declared in the package specification.

Usage Notes

WPG_DOCLOAD is normally invoked indirectly. A developer writes a PL/SQL procedure that queries the document table, then calls download_file (or the appropriate get_download_* variant) so that the gateway knows to stream the file instead of generating a standard page. Typical callers include Oracle Forms attachments, the Oracle Applications Framework file download controllers, and custom mod_plsql procedures configured behind a DAD. Because it is invoked in the context of an active HTTP request, it must not be called from concurrent programs or batch jobs. The ETRM metadata records no dependent packages referencing it, which reflects its nature as a terminal, gateway-facing API. Developers investigating content length discrepancies should examine GET_CONTENT_LENGTH together with the calling procedure's MIME type handling.