Upload Csv File in Oracle Apex Package
Noon application pages provide a mechanism for application users to load data from CSV files into awarding tables via Information Loading. In prior versions of APEX (pre-21.one) the Information Load definition would be specified during the Data Loading 'create page magician'. The wizard would contain the post-obit steps: Ascertain the Data Load: Once the 'create folio wizard' was completed, the Data Load definition created could be viewed and amended in 'Shared Components' under 'Data Sources'. The process has moderately inverse with version 21.1. Now the Data Load needs to be defined in 'Shared Components' prior to the creation of whatever associated pages. The idea backside this is to simplify the Data Load process for the end user where the aforementioned loads are repeated. Instead of the data source, mapping and validation being specified by the user in the wizard pages, they can now be defined by the developer for reuse past the user. Creating a Data Load definition is now a pre-requisite of building the Data Load pages and is undertaken by selecting 'Data Load Definitions' under Data Sources in Shared Components and clicking the 'Create' push. The wizard to create a Information Load definition is broadly similar (with knobs on) to a combination of the steps taken in previous versions by the developer to create the definition and the user to perform a Data Load. At present, information technology uses sample data to aid build the definition. It includes options to: And now the post-obit steps are applied during the definition phase past the programmer rather than at run time by the end user: A preview of the data tin can be viewed via a second tab to assist with the mapping. The sorcerer provides the developer with the choice of continuing to create an associated Data Loading page or saving the Data Load definition at this stage (the Data Loading page can and then be created afterward using the Create Page wizard). Once the Create Data Load wizard is completed the definition can be viewed and edited. At this point information technology is possible to configure or ameliorate the: Information technology'due south useful to annotation that assistance is available on both these parameters to understand the unlike settings. Once the Data Load definition has been completed, the Information Loading page tin can exist created. Equally previously mentioned, this tin can be completed as part of an extended Data Load Definition wizard or separately in the 'Create Page' wizard. Either way, the steps are the aforementioned, and simplified compared to the Data Loading create folio magician of previous versions as the Information Load has already been defined. Now the Data Load and page are ready to be run. The application page is at present much simpler. The end user only has to select the data e.g. choose a file with the File Browse folio item or paste the delimited data. Upon selecting the file (later clicking the 'Next' push if pasted delimited data is used), the data is shown in preview. It's worth noting that the information hasn't withal been loaded into a collection. So, click the 'Load Data' push button and the Data Load is executed. In prior version, the Data Load wizard made apply of a number of Apex collections to manage the data load, such equally: In version 21.1, these are dispensed with. The data, either from file or pasted data, is presented in 'Preview' on the application folio past making employ of the APEX_DATA_PARSER package. I have previously written a weblog on the APEX_DATA_PARSER package which tin can be establish here. The new APEX_DATA_LOADING parcel provides the ability to load data past calling an awarding Information Loading definition. This can be used in place of native data loading. The APEX_DATA_LOADING.LOAD_DATA part performs the load and there are ii broadly similar signatures, one for loading Hulk data eastward.one thousand. from a file, another for loading CLOB data due east.one thousand. from copied data pasted into a text area. The LOAD_DATA function returns load status information containing processed rows and fault rows in the 't_data_load_result' type. So, I created a page to select a file and load it equally blob into APEX_APPLICATION_TEMP_FILES (the blob could equally have been from another tabular array or created from a file in a directory). Then, as office of a post-submit process, I executed the APEX_DATA_LOADING.LOAD_DATA office specifying the name of the Data Load definition (p_static _id) and the hulk (p_data_to_load) to be loaded. The Excel file contents were successfully loaded into the collection, which I was then able to report on. APEX 21.i changed the manner Application Data Loads are created so that a greater emphasis of the definition sits with the developer. This simplifies the end-user process, removing the requirement for users to perform tasks that may exist repeated from 1 Information Load to the side by side for the same definition e.g. file definition and data mapping. In addition, with the availability of the APEX_DATA_LOADING API, the Data Load definition tin can be executed in stored procedures, which could help bypass user interaction and simplify code compared to using the APEX_DATA_PARSER API alone. The change represents quite an overhaul of the application Data Load process, and then information technology volition exist worth checking when future versions of APEX are released, whether Data Loads' built-in versions prior to 21.ane go deprecated or are removed. If this blog was of interest, be sure to discover more almost our Oracle Apex Services, we'd be happy to talk over the art-of-the-possible with y'all! Author : Philip Ratcliffe Job Title : Oracle Apex Development Consultant Bio : Philip is a Development Consultant at DSP-Explorer. Building on considerable feel in evolution including using Oracle PL/SQL and supporting Oracle EBS, Philip is employing APEX to provide quality, bespoke software solutions to a range of organisations.
Create 4 pages to be used by the application end users in the Data Load wizard:
Information Load Definition
Data Loading Page
APEX_DATA_LOADING Package
Conclusion
DSP-Explorer Oracle Noon Services
Source: https://content.dsp.co.uk/apex/enhancing-oracle-enterprise-manager-with-oracle-apex-0