-
Hello,
I have recently installed O9i R2 on WinXP with default Database, which is working fine.
When I issue MERGE statement I get ORA-00904.
I have two tables.
CONNECT scott/tiger@ORCL
CREATE TABLE tabA (Id NUMBER, Name VARCHAR2(100));
CREATE TABLE tabB (Id NUMBER, Name VARCHAR2(100));
I have INSERTed following records in tabA
INSERT INTO tabA VALUES (1, 'Test A');
INSERT INTO tabA VALUES (2, 'Test B');
INSERT INTO tabA VALUES (3, 'Test C');
INSERT INTO tabA VALUES (4, 'Test D');
Then One record in tabB
INSERT INTO tabB VALUES (1, 'Hello');
COMMIT;
When I issue following statement I get ORA-00904.
MERGE INTO tabB B
USING tabA A
ON (a.ID = b.ID)
WHEN MATCHED THEN
UPDATE SET
B.Id = A.Id,
B.Name = A.Name
WHEN NOT MATCHED THEN
INSERT VALUES (A.Id, A.Name);
Whereas I am expecting 4 records after executing
SELECT * FROM tabB;
Id ---------------- Name
1 ---------------- Test A
2 ---------------- Test B
3 ---------------- Test C
4 ---------------- Test D
Will anybody help me whats wrong in MERGE statement ?
Do I have to set any GRANTS or INIT.ORA parameters for MERGE statement?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|