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 > identity column sugeestions---urgetn

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-04, 09:08
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
Angry identity column sugeestions---urgetn

DB2 V 8.1 FP5
OS . SOL

I have lot of tables which are having identity columns .

They are of type GENERATED BY DEFAULT AS IDENTITY(STARTS with)

How do i load data into these kind of tables.
Right now , i am using the following load statements to load the data.

load from scheam.tabname.ixf of ixf MESSAGES tabname.messages insert into schema.tabname;

Is that right form of load statemetn for table has identity columns. I haven't seen any errors so far. But is there a chance getting duplicate data
Reply With Quote
  #2 (permalink)  
Old 07-21-04, 10:23
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
Any update???
Reply With Quote
  #3 (permalink)  
Old 07-22-04, 02:39
jsp2999 jsp2999 is offline
Registered User
 
Join Date: Jul 2004
Posts: 76
Re: identity column sugeestions

As it is identity column, so it will always generate new value for each new record. If your table don't have any previous data and you haven't reset the value of identity column then there is no chance of error while loading the data.
Reply With Quote
  #4 (permalink)  
Old 07-22-04, 12:41
famudba famudba is offline
Registered User
 
Join Date: Jan 2004
Location: Tallahassee, FL, USA
Posts: 96
you need to ignore identity columns , user identityignore option while loading.


here is sample

load from tst.ixf of ixf moddified by identityignore replace inot tablename;



This will work , let me know , if any questions


Thank You


Lekharaju Ennam
Reply With Quote
  #5 (permalink)  
Old 07-22-04, 14:13
prithvi_raj prithvi_raj is offline
Registered User
 
Join Date: Apr 2004
Posts: 36
Hi fam,

I guess the load statements works fine.
But i used a regular load statement with out identity ignore .
some thing like this.

"load from tst.ixf of ixf insert into tablename"

It just worked fine with identity column table also . No complaints.
I have been doing this for some time .
Is this a some thing new feature in V8.

And other thing i have observed is , even if i re run the same load statement with same syntax , it is just working fine with out complaints.
It is deleting the existing rows and inserting the new rows , even if i don't use the replace option.

since i am moving the stuff to production ,i want to stick to right syntax.
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