0

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.

now I want to insert the data into t1 by selecting table t2 data for those columns.

Thank you.

2
Contributors
4
Replies
16
Views
2 Years
Discussion Span
Last Post by Azii
0

Hi

I haven't used Oracle so this may not be correct, but you might be able to use something like the following:

INSERT INTO t1 (c2, c3, c4) SELECT c2, c3, c4 FROM t2

You might need to tweak it a bit.

HTH

Edited by djjeavons

0

Thank you, But how to Insert the remaining column values.

Insert into t1(c1,c2,c3,c4,c5)
"Select c2,c3,c4 from t2" --- only gives the value of c2,c3,c4

0

Solved, C1 and c5 data will be manual. so I used,
Insert into t1(c1,c2,c3,c4,c5)
select "a" as c1, c2, c3, c4, "b" as c5 from t2

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.