Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2008
    Posts
    10

    Unanswered: Insert multiple rows via script

    Hello,

    Would someone kindly show me a script that would insert multiple rows into a table? I am familiar with Oracle but not DB2. For example, I have a table with 5 columns and would like to insert 1000 rows with the same values except for the first column which ideally can be used as a variable. Any help is appreciated.

    Thanks,

  2. #2
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    It would help if you have listed your version and OS level. Consider what I did and put it in the signature.

    Plus, why not download manuals and check them first.
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

  3. #3
    Join Date
    Dec 2008
    Posts
    76
    Either the LOAD statement or the IMPORT statement will do this. Look in the manuals for a full explanation, they are too complicated to explain here.

    If you have questions once you have read the manuals, ask them here.
    RD

  4. #4
    Join Date
    Jan 2008
    Posts
    10
    Thanks for getting back to me. It is V9.5 on OEL 5 update 3.

  5. #5
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    Then you can download these manuals

    IBM - DB2 Version 9.5 for Linux, UNIX and Windows English manuals

    Check out Command center to be exact. Load and IMport. If you are only doing 5K you might want to look into Import first.
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

Posting Permissions

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