Results 1 to 4 of 4

Thread: Bulk Insert

  1. #1
    Join Date
    Mar 2004
    Location
    So Paulo, Brasil
    Posts
    4

    Post Unanswered: Bulk Insert

    Hello guys.. Im debut in this forum.
    Id like to know how to use "BULK INSERT" into STORED PROCEDURES. Whats the most important steps to take care? How to implement?

    thanx,

  2. #2
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220
    You probably want to use the load facility

    It is rather complex and requires dbmanager
    role or explicit granted access to the load utility.

    It has a great number of possible modifications

    I suggest you read the syntax guide, or access
    the topmost post in this forum. Depending on platform
    you can run the 'db2 ? load' command to get a complete
    syntax overview.

    Some modifiers that are important, and not often
    mentioned in guides are the 'rowcount', 'warningcount'
    and 'fastparse' options - check them out! :-)
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  3. #3
    Join Date
    Jan 2004
    Location
    Tallahassee, FL, USA
    Posts
    96

    Re: Bulk Insert

    Originally posted by yannickbh
    Hello guys.. Im debut in this forum.
    Id like to know how to use "BULK INSERT" into STORED PROCEDURES. Whats the most important steps to take care? How to implement?

    thanx,
    what are source tables & target tables

    if 1 to 1 or by joining more than table , target is only one table

    use just plan SQl statement in stored procedure.

    If you are complex manipulating data & insert into target table , use cursor to do that.


    let me know , what is your requirements.


    Thank You

    Lekharaju Ennam

  4. #4
    Join Date
    Mar 2004
    Location
    So Paulo, Brasil
    Posts
    4

    Re: Bulk Insert

    Guys,

    one of the scenarios I have is first of all, I do a simple select in a control table, therefore, I update a table, depending the selects result. Then I have to do the "bulk insert" and the syntax I found is:

    BULK INSERT <table> FROM 'C:\...\file.txt' WITH
    (DATAFILETYPE = 'CHAR',
    FORMATFILE = 'C:\...\out.for' TABLOCK'

    Is that correct? After all, I Update the table again with the correct status after loading the file. Any comments on my steps?

    thanx

    Originally posted by famudba
    what are source tables & target tables

    if 1 to 1 or by joining more than table , target is only one table

    use just plan SQl statement in stored procedure.

    If you are complex manipulating data & insert into target table , use cursor to do that.


    let me know , what is your requirements.


    Thank You

    Lekharaju Ennam

Posting Permissions

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