Inserting 1 Lac rows



IBM's flagship relational database management system

Inserting 1 Lac rows

Postby intelsami » Tue Mar 15, 2011 5:33 pm

Hi,

I have one task where i need to insert around 1 lac rows in a table by selecting the data from another table. I tried with
' INSERT INTO table1 (col1,col2)
SELECT col3, col4 FROM table2 WHERE cond1 = something; '

This will work if structure of table1 and table2 are same. But in our requirement we have different table structures. Can anyone help me out with this

Thanks
intelsami
 
Posts: 1
Joined: Tue Jan 18, 2011 10:40 am
Has thanked: 0 time
Been thanked: 0 time

Re: Inserting 1 Lac rows

Postby GuyC » Tue Mar 15, 2011 6:12 pm

not true, this will work as long as col1 is compatible with col3 and col2 with col4.
There is absolutely no requirements for identical structures in your example.
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Inserting 1 Lac rows

Postby prino » Tue Mar 15, 2011 7:42 pm

intelsami wrote:I have one task where i need to insert around 1 lac rows in a table by selecting the data from another table. ...

It would help if you could use normal units, according to Wikipedia, "lac" i's "the scarlet resinous secretion of a number of species of insects". Never knew DB2 could store this stuff, even though is called a "Universal Database"...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Inserting 1 Lac rows

Postby enrico-sorichetti » Tue Mar 15, 2011 8:11 pm

it' s the usual issue of people using local wording in a multilingual forum
from wikipedia
lac == lakh == 100000 units
crore = 100 lakhs

... always from wikipedia
... associated to the fact The Indian numbering system also uses separators differently from the Western system —
besides the three least significant digits of the integer part, a comma divides every two rather than every three digits, thus:
12,31,23,123 123,123,123
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Inserting 1 Lac rows

Postby DFSHDC40 » Wed Mar 16, 2011 4:03 am

...so it's back to 1's and 0's - Simple, universal and does exactly what it says on the tin!
If the code hasn't been changed, why is the LKED date today?
User avatar
DFSHDC40
 
Posts: 41
Joined: Sat Oct 16, 2010 4:16 pm
Location: IMS.SDFSRESL
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post