Bulk Insert question

  • Hello, i was wondering if it is possible to calculate a column while doing Bulk Insert. What I need to do is calculate the value of say column c in a table based on the first 3 characters in column a. Column c will not be part of the file being loaded. I do this in Oracle all the time using SQL*Loader control files. Can you do this using a Bulk Insert format file? Thank you.

    Best Regards,

    ~David

  • Note possible using Bulk Insert alone. Is possible if you use a calculated column on the target table and, maybe, a bcp format file... but a simple post-import update would be simple enough.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply