Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2013
    Posts
    1

    Exclamation Unanswered: Import Data from CSV to Table with modifications

    I need to import data from CSV file to a DB Table with some modifications to the data through sql Loader.

    I already have a command Line script to load Data as it is from CSV file to DB Table, But need a script to make a small tweak to the data.

    Batch File:
    'Path to sqlldr\sqlldr' Username/lpassword@ServerName CONTROL=Path to Control FIle/File.ctl LOG=Path to Log file/Doc.log BAD=Path to bad file/.bad skip=1

    Control File:
    LOAD DATA
    INFILE 'Path of CSV file.csv' "str '\n'"
    DISCARDFILE 'Path of DSC file/Doc.dsc'
    TRUNCATE
    INTO table Table Name
    FIELDS TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"' AND '"'
    trailing nullcols
    (
    Column one,
    Column Two,
    Column Three
    )


    Here i need to Modify the data in the Column Two.
    For example I have data in the Column Two is "Test Data", But i need to remove (" ") and load the data in to tables as Data Test.
    Can any One please help what changes do i need to make for this script or
    Suggest me with any other alternative.

    Thank You

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    This is extremely useful documentation, bookmark it and read it: SQL*Loader. As of now, you'll be interested in Applying SQL Operators to Fields.

Tags for this Thread

Posting Permissions

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