Column_Upload_Function

(Applies only to Load Set and Program adapters.) Use this function to enable Definers to upload files (such as a SAS data set or XML file) to create Table Descriptors or Table Descriptor columns with the same metadata structure as the file.

You can also use this function to read table metadata in a database and create a Table Descriptor from it.

If you set the Adapter Area flag ALLOW_COLUMN_UPLOAD to File (for a file system) or Yes (for a database), the Upload Columns button is enabled in the user interface and the system invokes the column upload function when required; see Creating an Adapter Area.

The system creates a BLOB from the file and passes a name/value pair in the parameter pi_cNameValuePair with name = TMP_BLOB_ID and a value equal to the BLOB_ID of the uploaded file. You write the column upload function to read the BLOB using the ID passed and process it to create either a Table Descriptor, including its columns, or just columns for an existing Table Descriptor.

Oracle Life Sciences Data Hub has an Upload button for new Table Descriptors on the Table Descriptor subtab on the Load Set and Program definition and instance pages. It also has an Upload Columns button on the Table Descriptor page. The system invokes the Column Upload function when the user clicks the Upload button in either location. You can write the function so that it calls the public API CDR_PUB_DF_TABLE.UPLOADOPERATORCOLUMNS to upload columns or an entirely new Table Descriptor:

  • If you call the API to create an entirely new Table Descriptor, leave the Object ID and version parameters null since they do not exist. The API creates a new Table Descriptor and assigns an Object ID and version number to it.
  • If you call the API from the context of an existing Table Descriptor to update its columns, pass the Table Descriptor's Object ID and version number to the API.

In the case of uploading columns to an existing Table Descriptor, the API updates the existing column definitions inOracle LSH if there are differences.

If the adapter uploads database table structures, use the following two definition functions (Auto_Add_Tab_Desc_Function and Auto_Add_Tab_Desc_LOV.

Create Parameters in a Parameter Set with the name PARAMETERSET_LOADSETLEVEL_DEF to collect the name and location of the file—or the remote location and connection—from the Definer; see Planning Parameters and Parameter Sets and reference these parameters in your column upload function.

The Column_Upload_Function must have the following signature:

PROCEDURE UploadOperatorColumns (pi_nCompanyID IN CDR_DF_NAMING_V.COMPANY_ID%TYPE
  ,pi_nLSRObjID         IN CDR_DF_NAMING_V.OBJ_ID%TYPE
  ,pi_nLSRObjVer        IN CDR_DF_NAMING_V.OBJ_VER%TYPE
  ,pi_nOperObjID        IN CDR_DF_NAMING_V.OBJ_ID%TYPE
  ,pi_nOperObjVer       IN CDR_DF_NAMING_V.OBJ_VER%TYPE
  ,pi_cNameValuePair    IN CDR_NAME_VALUE_PAIR_COLL DEFAULT 
NULL) IS

The procedure's parameters take values as follows:

  • pi_nCompanyID see Getting Your Company ID
  • pi_nLSRObjID takes the Object ID of the Load Set or Program definition.
  • pi_nLSRObjVer takes the object version of the Load Set or Program definition.
  • pi_nOperObjID takes the Object ID of the Table Descriptor.
  • pi_nOperObjVer takes the object version of the Table Descriptor.
  • pi_cNameValuePair The system creates a BLOB from the uploaded file and passes a name value pair with name = TMP_BLOB_ID and value = BLOB_ID_of_the_uploaded_file.