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 > Help with importing data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-04, 19:52
Shinto Shinto is offline
Registered User
 
Join Date: Jan 2004
Posts: 25
Help with importing data

HI, i am new to the DB2 environment.

Right now i have some data saved in .csv format. I then opened up DB2 control center and right click on the table i wish to insert data in. i then clicked insert data and did all the necessary steps to insert the data. However, i got an error message "SQL0798N A value cannot be specified for column ENO which is defined as GENERATED ALWAYS"

Is that anyway to solve this? Dont ask me to drop the ENO column as i need it for coding purposes. Thanks.
Reply With Quote
  #2 (permalink)  
Old 02-05-04, 19:58
dollar489 dollar489 is offline
Registered User
 
Join Date: Sep 2002
Posts: 456
Re: Help with importing data

Take a look at the import command syntax, there is an option of GENERATEDIGNORE option which you can specify while loading the data.

dollar

Quote:
Originally posted by Shinto
HI, i am new to the DB2 environment.

Right now i have some data saved in .csv format. I then opened up DB2 control center and right click on the table i wish to insert data in. i then clicked insert data and did all the necessary steps to insert the data. However, i got an error message "SQL0798N A value cannot be specified for column ENO which is defined as GENERATED ALWAYS"

Is that anyway to solve this? Dont ask me to drop the ENO column as i need it for coding purposes. Thanks.
Reply With Quote
  #3 (permalink)  
Old 02-05-04, 20:03
Shinto Shinto is offline
Registered User
 
Join Date: Jan 2004
Posts: 25
GeneratedIgnore option? Sorry am really new to DB2, could ya guide me step by step into loading the data? Sorry for any incovenience caused.
Reply With Quote
  #4 (permalink)  
Old 02-05-04, 20:05
dollar489 dollar489 is offline
Registered User
 
Join Date: Sep 2002
Posts: 456
db2 import from test.txt of del modified by generatedignore insert into test

you can change the table name and file name and use other options as required.

dollar

Quote:
Originally posted by Shinto
GeneratedIgnore option? Sorry am really new to DB2, could ya guide me step by step into loading the data? Sorry for any incovenience caused.
Reply With Quote
  #5 (permalink)  
Old 02-05-04, 20:10
Shinto Shinto is offline
Registered User
 
Join Date: Jan 2004
Posts: 25
err, i mean how do u actually import it in and where do i type in that command u listed above?
Reply With Quote
  #6 (permalink)  
Old 02-05-04, 20:14
dollar489 dollar489 is offline
Registered User
 
Join Date: Sep 2002
Posts: 456
I imagine you use windows so do this...
open up command window....
then type db2cmd and press enter...it will open up another window... then type db2 connect to dbname user username using password..this will connect you to the database
then change to the directory where you have the .csv file
then type the command I told you earlier and change the file name and table name in that command...

hope this helps

dollar


Quote:
Originally posted by Shinto
err, i mean how do u actually import it in and where do i type in that command u listed above?
Reply With Quote
  #7 (permalink)  
Old 02-05-04, 20:25
Shinto Shinto is offline
Registered User
 
Join Date: Jan 2004
Posts: 25
hmm, i tried yur instructions and i got the following error message.

SQL3526N The modifier clause "GENERATEDIGNORE" is inconsistent with the current load options. Reason code :"3".

What does the above means?
Reply With Quote
  #8 (permalink)  
Old 02-05-04, 20:34
dollar489 dollar489 is offline
Registered User
 
Join Date: Sep 2002
Posts: 456
can you send me the command you used as well as the error message along with sample data...

dollar

Quote:
Originally posted by Shinto
hmm, i tried yur instructions and i got the following error message.

SQL3526N The modifier clause "GENERATEDIGNORE" is inconsistent with the current load options. Reason code :"3".

What does the above means?
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