This discussion is archived
0 Replies Latest reply: Mar 6, 2013 6:12 AM by 991247 RSS

End User Data Upload -  Error

991247 Newbie
Currently Being Moderated
Hi Friends,

Could you help me out with this:
I am trying to utillize the Data upload feature in Oracle APEX 4.2.
Procedure:
Create New Page > Data upload

I am giving a transformation here which checks for existing data. If data exists, the transformation updates the table else inserts. I am using the Merge command to execute this:

I am using a "PL SQL Function" here,

BEGIN
MERGE INTO DEPT TARGET
USING (SELECT :DEPTNO DEPTNO, :DNAME,:LOC FROM DUAL) SOURCE
ON (TARGET.DEPTNO = SOURCE.DEPTNO)
WHEN MATCHED THEN
UPDATE SET TARGET.DNAME = SOURCE.DNAME, TARGET.LOC=SOURCE.LOC
WHEN NOT MATCHED THEN
INSERT (TARGET.DEPTNO, TARGET.DNAME, TARGET.LOC) VALUES(SOURCE.DEPTNO, SOURCE.DNAME,SOURCE.LOC);
END;

It is a simple DEPT table which as 3 columns(DEPTNo, DNAME, LOC)

But it always throws me an error like

Sequence Action DEPTNO DNAME LOC
1 FAILED 52 EMPLOYEE MUMBAI
2 FAILED 61 TEST TEST


What is that i am doing wrong here. I have tried this before and it used to work earlier. But unfortunately it is not working now.

Your help would be appreciable.

Thank you,
Srikumar S

Edited by: Srikumar S on Mar 6, 2013 6:12 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points