Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Incrementing a value of a variable in insert

User648426-OracleNov 5 2008 — edited Nov 6 2008
Hi,
I have an insert statement like

Insert into table1(column1,column2)
(select 1, value2 from table2);

Is there a way without using the sequence that we can increment the "1" and insert in the table1

For eh

Lets say table2 is

Table2
Value2
-------------
Books
Glasses
TV

I want to insert following in table 1
Column1 Column2
1 Books
2 Glasses
3 TV

I cannot use sequences here. Is it possible to do this by some bind variable?

Thanks in advance!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2008
Added on Nov 5 2008
5 comments
3,313 views