If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Insert into a table with identity col

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-19-10, 19:55
ncmdba ncmdba is offline
Registered User
 
Join Date: May 2010
Posts: 8
Insert into a table with identity col

Hello,

I have to select cols from a table and insert into another table which is having col integer generated always as identity.

for example T1 has 5 cols.T2 has same 5 cols + identity col.

What would be the syntax.

I am trying the following but not working

db2 "insert into dev04.identity2 (Select HSN,C3,C4 from dev04.identity1)"

Can anyone give me the right syntax...

Thanks
Reply With Quote
  #2 (permalink)  
Old 05-19-10, 21:06
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I think you should get used to specifying columns that you want to insert into. Correct syntax can be found in the manual.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On