Skip to content Skip to sidebar Skip to footer

Update Database in Apex 5.1 via Upload

 
Oracle Database Tips by Donald Burleson

Using APEX to Create the File Scan� Detail

1. Click the  icon in the Items surface area.

two. On the Particular Type page, choose the File Scan choice and click Next.

3. On the Display Position page:

Item Proper name: P1090_NAME

Sequence: 10

Region: Image Upload

Click Next.

4. On the Item Attributes page:

Label: Prototype File Proper noun.

Field Width: 80

Click Next.

v. On the next folio click on the Create Item button.

Create the Upload Button

Now information technology is fourth dimension to provide a button to submit the folio.  The file volition be uploaded when the folio is submitted.

1. Click the  icon in the Buttons surface area.

ii. On the Push Region page, click Next.

3. On the Push button Position page, choose the Create a button in a region position option and click Side by side.

4. On the Push button Attributes page, enter UPLOAD for the Push button Name and click Next.

5. On the Image Attributes folio, click Next.

6. On the Display Properties page, click Next.

7. On the Branching page enter &APP_PAGE_ID. for the Branch to Page field and click Create Button.  Remember the ending menstruation!

Create the Copy Image Process

This process is going to move the record inserted into the wwv_flow_files view over to the new easy_image table.

one. Click on the  icon in the Processes area of the Page Processing region.

2. On the Process Blazon page, choose the PL/SQL pick and click Next.

three. On the Process Attributes page:

Name: Copy Image

Sequence: 10

Point: On Submit - Afterward Computation and Validations

Click Adjacent.

4. On the Process folio, enter the following for the PL/SQL Page Procedure and click Next.  The full text can be found in file copy_image_process.sql in the online lawmaking depot.

begin
--
-- When an paradigm is uploaded it is stored in the
-- FLOW_FILES.WWV_FLOW_FILE_OBJECTS$ table.
-- The wwv_flow_file_objects$ table is identified
in the dads.conf
-- file in the PlsqlDocumentTablename
 parameter.
-- WWV_FLOW_FILES is a view to this table.
--
-- Nosotros want to proceed the paradigm in our own table.
-- Copy the image from WWV_FLOW_FILES to our own
EASY_IMAGE table.
--
insert into easy_image(
image_id, name, filename,
mime_type, doc_size, created_by,
created_on, content_type, blob_content )
select id, proper noun, filename,
mime_type, doc_size, created_by,
created_on, content_type, blob_content
from   wwv_flow_files
where  name = :P1090_NAME;
--
-- Now that we take copied the prototype to our own EASY_IMAGE table
-- delete it from the WWV_FLOW_FILES table.  That way we can keep
-- the files from growing too much in the WWV_FLOW_FILES and make
-- it easier for utilize to brand backups of our information.
-- Deleting the record is done by referencing the NAME cavalcade.
-- When the file is uploaded the P14_NAME page item will be set to
-- the value of Name that was put into the WWV_FLOW_FILES table
-- and we can use it for reference.
--
delete from wwv_flow_files where proper noun =
:P1090_NAME;
terminate;

5. On the Bulletin page:

Success Bulletin: Epitome successfully loaded.

Failure Message: Image could not be loaded.

Click Next.

6. On the Process Conditions page:

When Button Pressed: Select the UPLOAD particular.

Click Create Procedure.

The page to upload an image is now complete.  Run the new application folio and have a wait.  The finished page is shown in Effigy nine.one with the Image File Name filled in.

Uploading an Paradigm

On the newly created application page, click on the Scan� push and navigate to the C:\htmldb_book\CodeDepot\images\niagara_falls.jpg  file.  Afterwards selecting the file, click the Upload push.

The post-obit is going to happen when the push is clicked:

The application folio is submitted and the fact that is beingness submitted by pressing the Upload button is stored in the HTML request as UPLOAD.

The image is automatically inserted into the wwv_flow_files view.

When the image is inserted the P1090_NAME folio detail volition be set to a value of F22557/niagara_falls.jpg.  NOTE:  the F22557 will be different on each organisation.  Since the wwv_flow_files has a unique index in the Proper name column, the value in the P1090_NAME page detail tin can exist used to select information about the image that was merely inserted.

The page process Copy Image will be executed to motility the image tape to the EASY_IMAGE tabular array.  The process is executed on the condition of the UPLOAD button beingness pressed.  Also, the process uses the P1090_NAME page particular in the SQL statements to copy the image.

The folio will be rendered and the results will exist displayed.


The in a higher place volume extract is from:

Easy HTML-DB Oracle Awarding Express

Create Dynamic Web Pages with OAE

ISBN 0-9761573-1-4

Michael Cunningham & Kent Crotty

http://www.rampant-books.com/book_2005_2_html_db.htm

campbellheing2002.blogspot.com

Source: http://www.dba-oracle.com/t_easy_html_db_file_browse_item.htm

Postar um comentário for "Update Database in Apex 5.1 via Upload"