Oracle Apex practical notes Series 2, oracleapex

Source: Internet
Author: User

Oracle Apex practical notes Series 2, oracleapex
1. Page Design

Page A has several region, one of which is used for file list management (including display, download, and delete) and. There is A button on page A. Clicking it will call page B. Page B is responsible for file upload, and page B is responsible for file upload.

Figure


Figure B


2. Database Table Design
File
FILE_ID Number,
FILE_DESC Varchar2 (256 ),
CONTENT Blob,
Mime_type varchar2 (256 ),
Char_set varchar2 (256 ),
Last_update date,
FILE_NAME varchar2 (256)


3. Apex 3.1: You can create A classic report region on page A to obtain the list of uploaded files. The region source is
Select f. FILE_ID,
F. FILE_DESC,
F. FILE_NAME,
Dbms_lob.getlength ("FILE_CONTENT") as FILE_CONTENT,
MIME_TYPE,
CHAR_SET,
LAST_UPDATE,
'<A href = "javascript: $ s (''p530 _ DELETE_FILE'', ''' | F. FILE_ID | '''); "> Delete </a> 'as DELETE_FILE
From FILE f

Note: Because BLOB cannot be directly mapped to page elements, the dbms_lob.getlength function is used to obtain the blob size as a placeholder.
In the Report Attribute label, click FILE_CONTENT to enter the cloumn settings: 1. number/Date Format select Blob; 2. format Mask: Download; 3. blob Table: FILE4. Blob Column: FILE_CONTENT5. primary Key Column 1: FILE_ID; 6. mimetype Column: MIME_TYPE; 7. FIlename Column: FILE_NAME; 8. last Updated Column: LAST_UPDATE; 9. character Set Column: CHAR_SET; 10. download Text: Download
3.2 one reason why page B uploads a file using page B as a separate page is that Apex cannot create multiple forms on a Table on a page. In other words, only one Form on a Table can be created on a page of Apex. The advantage of creating a Form on a Table page is that Apex can help us manage Table insertion and update details. Therefore, to create page B, you only need to follow the Apex create Form on a Table wizard step by step.
When modifying the item corresponding to FILE_CONTENT, display as: Select File Brows in its setting tag, 1. storage Type: Blob column specified in Item Source attribute; 2. mimetype Column: MIME_TYPE; 3. FIlename Column: FILE_NAME; 4. last Updated Column: LAST_UPDATE; 5. character Set Column: CHAR_SET;

In Storage Type, another option is Table WWV_FLOW_FILES, which is a built-in Table of Apex for file upload. This is the practice of the old Apex version and is retained for backward compatibility. If this option is selected, all the File Upload functions of different applications will be sent to this table. In this case, the file management will be somewhat confusing and tends to create your own database tables for management.



ORACLE APEX

Please use WITZARD. There is a drop-down option

Oracle APEX Chinese manual

This is really not

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.