Oracle Apex Plugin to upload excel to Database
COLLECTION SELECT STATEMENT :
------------------------------------------
SELECT seq_id seq
,C001 EMPNO
,C002 DT
,C003 INOUT
FROM apex_collections
Where COLLECTION_NAME='XLS';
PLUGIN NAME : Excel2Collection
PROCESS :
BEGIN
FOR C_XLS IN
(
SELECT seq_id seq
,C001 EMPNO
,C002 DT
,C003 INOUT
FROM apex_collections
Where COLLECTION_NAME='XLS'
AND LTRIM(RTRIM(C001))<>'Empno')
LOOP
INSERT INTO ATTENDENCE VALUES (
TO_CHAR(C_XLS.EMPNO),
TO_DATE(substr(ltrim(rtrim(C_XLS.DT)),1,10),'DD-MM-YYYY'),
C_XLS.INOUT);
END LOOP;
apex_application.g_print_success_message := '<span>'||'Excel Data Uploaded. '||'</span>';
END;
CLEAR :
APEX_COLLECTION.TRUNCATE_COLLECTION(p_collection_name => 'XLS');