Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Posts
    25

    Unanswered: 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.

  2. #2
    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

    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.

  3. #3
    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.

  4. #4
    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

    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.

  5. #5
    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?

  6. #6
    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


    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?

  7. #7
    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?

  8. #8
    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

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •