18.1 Creating Applications with Data Loading Capability
Create applications with data loading capability that enable end users to dynamically import data into a table within any schema to which the they have access.
To import data, end users run a Data Load Wizard that uploads data from a file or copies and pastes data entered by the end user directly into the wizard.
- About Creating a Data Load Wizard
- Creating a Data Load Wizard
- Re-creating Data Load Pages
- Editing the Data Load Definition
See Also:
"Data Loading Wizard Examples" in Oracle Application Express End User Guide to learn about using the Data Load Wizard.
Parent topic: Managing Application Data
18.1.1 About Creating a Data Load Wizard
To create a Data Load Wizard, an application developer creates a Data Load page with the Create Page Wizard. During the process of creating the Data Load Wizard, developers can specify the upload table and its unique columns, table lookups, and data transformation rules.
Note:
A Data Load Wizard is not designed or intended to load hundreds of thousands of rows of data. While it is possible to use a Data Load Wizard to load this high volume of data, you may encounter performance issues with both transmitting and loading large data files. Tools like Oracle SQL Developer and Oracle SQL*Loader are better suited to loading large volumes of data.
The Data Load Wizard includes support for the following:
-
Table Definitions - This definition specifies the data upload table name with its unique key columns.
-
Data Transformation Rules - For formatting transformations such as changing import data to uppercase, lowercase, and so on, you must define data transformation rules. For example, if the import file includes column data with both upper and lowercase and the upload table requires all uppercase, you can define a data transformation rule to insert only uppercase into the target column.
-
Table Lookups - If data existing in the import file must be mapped to data in another table, specify a table lookup to perform the mapping. For example, if the import file contains a department name for the
DEPTNO
column but the upload table requires a number for that column, use a table lookup rule to find the corresponding department number for that department name in another table. -
Column Name Aliases - There are many situations when a developer does not wish to expose the table column names to the end user, or to expose all columns to the end user. In those situations, you can create a column aliases for the columns that need to exposed.
-
Manage Concurrency - If multiple users are uploading data at the same time, developers can use extra column to track the version of data in the underlying table. The Data Load Wizard can use this column to check and signal the end user if anyone else is working with the same data at the same time. This is particularly important if uploading into a table that is regularly updated.
-
Multiple Spreadsheet Columns - There are many situations when a spreadsheet to be uploaded has multiple columns that the developer wants to concatenate and upload in to one table column (for example
FirstName
andLastName
on spreadsheet can be uploaded intoENAME
of theEMP
table). -
Skip Validation - You can improve data loading performance when uploading a large number of records by skipping the validation step. If uploading thousands of records, the end user might not be interested in validating each record. If you are certain that each record will be inserted as new record, the data loading process does not need to check for duplicates.
The newly generated Data Load Wizard consists of four pages that provide users with the ability to upload data from a file or by copy and paste, define data and table mappings, validate the data, and finally to upload the data to the table. The developer can later edit the Data Load Wizard's definitions such as table lookups and data transformation rules, by accessing Shared Components, Data References, Data Load Definitions.
Supported Data Types
Data Load Wizards support the following data types:
-
VARCHAR2
-
DATE
-
TIMESTAMP
-
NUMBER
Unsupported Data Types
Data Load Wizards do not support the following data types:
-
Large objects (
BLOB
andCLOB
) -
Complex types (
XMLTYPE
andSDO_GEOMETRY
) -
CHAR
See Also:
Parent topic: Creating Applications with Data Loading Capability
18.1.2 Creating a Data Load Wizard
To create a Data Load Wizard:
- On the Workspace home page, click the App Builder icon.
- Select the application.
- Click Create Page.
- For Create a Page:
- For Data Load Table:
- Data Load Definition - Choose whether to create a new or to re-use an existing Data Load definition.
- Definition Name - Enter the name of this data load definition.
- Owner - Select the owner of the table on which the form will be based..
- Table Name - Select the table to use for data loading (also known as the upload table).
- Unique Column 1 - Identify the column name(s) to be used as the primary unique key column during the data load process. You can define up to 3 unique key columns.
- Case Sensitive - Identify whether the selected unique key column is case sensitive. By default, this is set to No.
- Define additional Unique Columns. You can define up to 3 unique key columns.
- Click Next.
- For Add Transformation Rules (optional), specify the following then click Add.
- Select Column(s) to create a transformation rule - Select the column on which the transformation rule definition is to be based and move them to the right.
- Rule Name - Enter a name for this transformation rule.
- Sequence - Specify the sequence for the transformation rule. The sequence determines the order of execution.
- Type - Select the type of transformation rule you want to perform.
- Provide additional details based on the transformation type you have chosen.
- Click Add Transformation.
- Click Next.
- For Table Lookups:
- Add new table lookup for Column (optional) - Identify the column on which the table lookup definition is to be based.
- Lookup Table Owner - Select the owner of the lookup table.
- Lookup Table Name - Identify the table to be used for this table lookup definition.
- Return Column - Select the name of the column returned by the table lookup. This value will be inserted into the load column specified and is generally the key value of the parent in a foreign key relationship (for example:
DEPTNO
). - Upload Column - Select the name of the column end users will upload instead of the return column. This is the column that contains the display value from the lookup table (for example:
DNAME
). - Upload Column 2 - Select the name of the second column to be uploaded to uniquely identify the return column if necessary. For example, to uniquely identify a State Code it may be necessary to upload the State Name and Country.
- Upload Column 3 - Select the name of the third column to be uploaded to uniquely identify the return column.
- Click Add lookup to add the lookup definition. Repeat the previous steps to add additional table lookups.
- Click Next finish creating lookups.
- For Page Attributes:
- Page Name - Enter a page name for each step.
- Page Number - Enter a page number for each step.
- Page Mode - Identify the page mode. To learn more, see field-level Help.
- Breadcrumb - Select whether you want to use a breadcrumb navigation control on your page and which breadcrumb navigation control you want to use.
- Click Next.
- For Navigation Menu:
- Navigation Preference - Select how you want this page integrated into the Navigation Menu. To learn more, see field-level Help.
- Click Next.
- For Buttons and Branching, specify the branching for the buttons on the data load wizard pages:
- New Button Label - Enter text to display on the Next button.
- Previous Button Label - Enter text to display on the Previous button.
- Cancel Button Label - Enter text to display on the Cancel button.
- Cancel Button Branch to Page - Specify the page number to branch to when the user clicks Cancel.
- Finish Button Label - Enter text to display on the Submit button.
- Finish Button Branch to Page - Specify the number of the page to branch to. You can choose to branch back to the same page or any other page in your application.
- Click Create.
- Click Save and Run Page to test the Data Load Wizard.
Tip:
After creating Data Load Wizard pages, if you wish to make changes, Oracle recommends re-creating new pages without deleting the data loading definitions as described in the next section.
See Also:
Parent topic: Creating Applications with Data Loading Capability
18.1.3 Re-creating Data Load Pages
If you wish to make changes to your Data Load Wizard pages, Oracle recommends re-creating new pages without deleting the data loading definitions.
To re-create Data Load Wizard pages without deleting the data loading definitions:
Parent topic: Creating Applications with Data Loading Capability
18.1.4 Editing the Data Load Definition
A Data Load Definition is comprised of a data load table, table rules, and lookup tables used by the Data Load Wizard in your application. A data load table is an existing table in your schema that has been selected for use in the data loading process, to upload data.
To edit a Data Load Definition:
Parent topic: Creating Applications with Data Loading Capability