Azii 0 Newbie Poster

Hello All,

I want to write the plsql stored procedure to insert multiple rows in a table.

Table t1, table t2.
Table t1 column names(c1,c2,c3,c4,c5)
table t2 column name (c2,c3,c4)
column names c2, c3, c4 are same in both tables.

BEGIN

INSERT into t1(c1,c2,c3,c4,c5)
select "a" as c1, c2, c3, c4,"b" as c5 from t2.

Now it will insert the rows, but it will lead to duplication of records, if data already exists, It should just update that record instead of creating new row.
how overcome this insertion anamoly?

Thank you.