0
votes

I am new to PL/SQL merge command. Can any one help me. I want to add new record MERGE MATCHED THEN case or initialization new variable in Match THEN Case of MEGE query of ORACLE.

MERGE INTO table itr
WHEN MATCHED THEN
Update Set
/*Here to add new record or initialization new variable*/
WHEN NOT MATCHED
Insert values

I'm getting the following error:

ORA-06550: line 91, column 10: PL/SQL: ORA-00905: missing keyword while try to add new record or initialization new varibale

Please any one help me.

1
What issue you have?Muhammad Muazzam
ORA-06550: line 91, column 10: PL/SQL: ORA-00905: missing keyword while try to add new record or initialization new varibaleCharnjeet Singh
You are missing Using commandMuhammad Muazzam
can you provide me example?Charnjeet Singh

1 Answers

2
votes

MERGE statement pseudocode

MERGE into <target table>
USING
    <souce table/view/result of subquery>
ON
    <match condition>
WHEN MATCHED THEN
    <update clause>
    <delete clause>
WHEN NOT MATCHED THEN
    <insert clause>