SQL*Loader - How to load only a few columns from a .csv file to ora table

Hi there,
Could anyone please let me know how to load few columns from a .csv
file into a oracle table using SQL*Loader.
I know how to create a .dat and .ctl file and run the sql loader.
Suppose I have a .csv file with
col1, col2, col3, col4
and I only need to load col1 and col3 into col_a and col_b respectively
in table_a?
structure of table_ a
col_a,
col_b
Please advice

Try like..it i will work..
LOAD DATA
INFILE 'test.txt'
LOAD DATA
TRUNCATE INTO TABLE T1
FIELDS TERMINATED BY ','
(col1,
col2 FILLER,
col3,
col4 FILLER
)

Similar Messages

  • How to SQL*loader to skip some columns from the source file?

    I am using oracle9i sqlldr to load some .csv files into db.
    If I want to skip the first two columns in the source file, can I do that?
    If yes, how should I specify it in the ctl file?
    Thanks
    Wendy

    Hello Dave,
    Here is a sample of what you'll need to have in your control fileLOAD DATA
    APPEND
    INTO TABLE <target_table>
    FIELDS TERMINATED BY ','
    ( column_1  FILLER
    , column_2
    , column_3
    , column_4  FILLER
    )Hope this helps,
    Luke

  • Need help in loading data from a csv file to a table in Oracle DB

    Hi,
    I am using sqlplus as a client to connect to the server.
    I am trying to load data from a csv file from a client to a table in Oracle DB server.
    I am trying to use the below command
    " LOAD DATA INFILE 'test.csv' INTO TABLE testTable FIELDS TERMINATED BY ',' (test1,test2,testc3,testc4); "
    But, I am encountered with the following error
    "SP2-0042: unknown command "load data" - rest of line ignored."
    Thanks in advance.
    SB

    Hey Frostmann,
    That was a nice post....
    I changed my mind to use an 'Insert into' statement from a shell script.
    I created a DB table named test and I tried using the below shell script to insert a row in the table.
    sqlplus test/test@test <<ENDOFSQL
    INSERT INTO test VALUES('test1',123,'test2','test3');
    exit
    ENDOFSQL
    A row is succesfully inserted into the table when I run the script manually, but it does not insert rows when a cron job is scheduled.
    Could you please help me with this?
    Thanks in advance.
    SB

  • How to import categories to my addressbook from a csv file?

    Hello, I have a few contact list (csv) i want to add in my thunderbird adressbook. tought, I can' t find a way to add the categories of my contacts when i import my list of contacts from a csv files to my thunderbird adressebook. As you can see in the image, in the Edit contact window there is a section named categories, and ussually you click that section and you decide whatever the contact is a friend, a parent etc. Well I want to import that information from a csv file already made and not setup up the categories from each contact one by one. Ok thank you very much!

    You need a vCard (.vcf) format, not .csv.  Were these exported from Outlook?

  • How do I remove e-mail addresses from a csv file referencing a numbers doc

    Greetings! I hope someone out there can help me. I'm not exactly a genius when it comes to numbers...
    My Issue:
    I'm attempting to sending out a large e-mail blast via software called hoolie, it seems to be working amazingly well except for the fact that I've reached our Gmail accounts daily limit which I had zero idea existed.
    So about 1100 emails were sent and I still have to send about 1500 emails left to be sent. The software has no ability to resend to the failed e-mail addresses, so I'm left to my own devices...
    My Goal:
    I want to be able to subtract out the 1100 e-mail address from the csv file I have with all the addresses. Once I subtract out the e-mail addresses I can then resend the blast and throttle it so it takes a day or so and won't freak out google gmail...
    How can I accomplish this? I have the orginal CSV file with all the names and e-mail addresses and I have a new numbers doc in which I pasted the e-mails that were succesfully sent...
    Thoughts? Suggetsions?
    thanks in advance!

    Are you suggesting that it sent it to a random sample of the email addresses, that it did not start at the beginning and go row by row until it failed?  If that is the case, you can import the CSV file into Numbers, paste your list of sent addresses in another column or another table of that document, then use COUNTIF to look for duplicates.
    The best I can do is an example.Your table will no doubt be different so you'll have to rejigger the formula.
    Importing your CSV file will create column B
    Insert two new columns, C and D
    Use Copy/Paste to copy/paste your list of sent addresses from your other document into column D
    The formula in column C is =IF(COUNTIF(D,B)>0,"Was Sent","")
    Once it has done its thing, sort by column C to get all the "Was Sent" rows together. Delete them. Delete column C, Delete column D. Share as a CSV.

  • How to Remove totals on few columns from SEM BPS layout

    On SEM BPS layout it has 10 5 charatestics columns
    and 10 key figure columns.
    out of these key figures I want see totals on some
    coulmns and for few columns I do not want to see totals.
    for wxample it does not make sense of seeing total under
    the salary incrase percentage coulmn.
    Please suggest anyway we can remove total for some  
    columns on the layout

    Hey, thanks -- everything worked as you described. It never would have occurred to me that the "put back" button refers to the browser selection not the layout selection, for reasons I give below.
    I think Aperture exhibits some conceptual confusion here. First of all, a "light table" is created by the New > Light Table command, and you add images to the newly created light table just as you would add them to an album. But those images don't go on the light table layout until you drag them from the browser to the layout table. The "put back" button and "remove from light table" contextual menu command both mean remove from the layout. The phrasing of the contextual menu command make it sounds as if it will remove the clicked image from the light table's collection of images, like removing an image from an album -- it would have made more sense to name this command "put back". Furthermore, the "put back" button is above the layout display, not above the browser, which to me implies that it applies to selections in the layout display. To select an image in the browser, and click "put back selected" seems backwards -- if you just selected the image in the browser, your attention is focused on the browser, not the layout; from the browser's point of view, the button should read "bring back" not "put back".
    The documentation didn't really help when I was trying to figure this out. Sometimes the Aperture documentation refers to just a "light table", as on the overview on page 732. On pages 733 and 734, though, it refers to a "light table album". On page 735 of the Aperture manual there is a very brief explanation of how "to add images to the light table" and "to remove an image from the light table". Here, "light table" refers to the layout not the album. The explanation of the "Put Back Selected" button says to select an image then click the button, and the picture shown is of an image selected in the layout, not in the browser.

  • How to read and select only a specific lines from a CSV file. Pls help

    I have a java application to read a CSV file. I've already managed to read them all and output it to System.out.println(). Now the problem is I want to select a specific row of the records. How do I do it? Below is the codes i've typed.
    FileReader fr = new FileReader(fileName);
    BufferedReader inFile = new BufferedReader(fr);
    StringBuffer buf = new StringBuffer();
    String line = null;
    while ((line = inFile.readLine()) != null) {
    buf.append(line);
    buf.append("\n");
    String inString = buf.toString();
    System.out.println(inString);
    This is the record that i want to read. For example, I want to select n print out line "80,2.90,3.00,3.10,3.20,......."
    [Factor1]
    Time [s],0.00,0.10,0.20,0.30,0.40,0.50,0.60,0.70,0.80,0.90,1.00,1.10,1.20,1.30,1.40,1.50,1.60,1.70,1.80,1.90,2.00,2.10,2.20,2.30,2.40,2.50,2.60,2.70,2.80,2.90,3.00,3.10,3.20,3.30,3.40,3.50,3.60,3.70,3.80,3.90,4.00,4.10,4.20,4.30,4.40,4.50,4.60,4.70,4.80,4.90,5.00,5.10,5.20,5.30,5.40,5.50,5.60,5.70,5.80,5.90,6.00,6.10,6.20,6.30,6.40,6.50,6.60,6.70,6.80,6.90,7.00,7.10,7.20,7.30
    Phi-0 [dB],-0.86,-0.80,-0.80,-0.99,-0.56,-0.53,-0.95

    If you know how many bytes each line is, you can use RandomAccessFile to skip directly to the byte position corresponding to your desired line. Otherwise, you'll have to read each line and just ignore the ones you don't want.

  • How to upload data into a database from a csv file in a jsp app?

    I can write a HTML form to let users to post a csv file and store it in the web server, then how could I process the file to load the data into a View Obj or an Entity Obj without manually parsing the csv files? Any jsp or java code samples that will do something like the "sqlload" in sqlplus?
    I'm using JDev 3.1.1.2. Thanks.

    Navy_Coder wrote:
    6 zebras.But you must marry his eldest daughter as well, for that dowry.

  • How can I extract a dates column from an ascii file

    I am extracting data from an ascii file and the rest of the data is extracted using read from spreadsheet, but the date appears as just the day e.g. 22 for 22nd, how can I get the date, format in ascii is e.g 22/04/2006, can I do this by specifying something at format of read from spreadsheet ? Cheers
    Emily

    Hi,
    I found the other day that there are instructions included inside the Read From Spreadsheet vi on how to modify it slightly to read strings rather than doubles.
    If you drop the Read From Spreadsheet  vi onto the block diagram and double click on it, you will open the front panel for the vi. If you then select the block diagram (for Read From Spreadsheet) you will see an 'instructions' frame below the main 'code', and the 3rd paragraph tells you how to modify the VI to read the spreadsheet as a set of strings rather then doubles. Save the vi as a new filename when you've edited it or you will overwrite the existing vi!
    Using the newly modified vi you can read in your entire spreadsheet, extract the dates as strings, then do any conversion necessary to the other columns of the sheet to change them into the types of value you require (eg doubles).
    I hope this helps.
    Mark
    Applications Engineer
    National Instruments

  • How can I import data from a csv file into databse using utl_file?

    Hi,
    I have two machines (os is windows and database is oracle 10g) that are not connected to each other and both are having the same database schema but data is all different.
    Now on one machine, I want to take dump of all the tables into csv files. e.g. if my table name is test then the exported file is test.csv and if the table name is sample then csv file name is sample.csv and so on.
    Now I want to import the data from these csv files into the tables on second machine. if I've 50 such csv files, then data should be written to 50 tables.
    I am new to this. Could anyone please let me know how can I import data back into tables. i can't use sqlloader as I've to satisfy a few conditions while loading the data into tables. I am stuck and not able to proceed.
    Please let me know how can I do this.
    Thanks,
    Shilpi

    Why you want to export into .csv file.Why not export/import? What is your oracle version?
    Read http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php
    Regards
    Biju

  • Button to load only a few frames within the timeline

    I am new to AS3 and was doing a little bit of research before diving in.
    I wish I could just create external swfs to load with each button, but the CMS system that I am uploading to won't allow it~
    so I HAVE to make the thing into one swf, but the file size is too large.
    Is it possible to make a button that loads only a few frames within the timelime? and the next button will load another few?
    this is what i found and it says i can't:
    http://stackoverflow.com/questions/791422/how-to-stop-flash-file-swf-from-loading-actionsc ript-3

    loading a swf file is an all or none issue.  once you start loading a swf, you can't stop it from proceeding to a complete load unless you unload the entire swf.

  • I have iphoto 6.  How do I only selecy certain photos from my camera when importing rather than all of them as show in the import page that loads

    I have iphoto 6.  How do I only selecy certain photos from my camera when importing rather than all of them as show in the import page that loads

    You use Image Capture (in your Applications Folder) for that job - or upgrade to a later iPhoto.
    Regards
    TD

  • How to load the data from .csv file to oracle table???

    Hi,
    I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
    Thanks in advance

    981145 wrote:
    Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
    the command is
    sqlldrType it and see if you have it installed.
    Have a look also at the FAQ link posted by Marwin.
    There are plenty of examples also on the web.
    Regards.
    Al

  • How to load csv file in oracle table

    Hi,
    i have csv files to which i want to load the csv file data and table structure in oracle. my csv files on the window machine but database is runing on ibm aix.so how to do it please any one can help me about. thanks a lot in advance
    i know th syntax below
    $sqlldr userid=username/password control=<filename> log=<log filename>

    Hello,
    Yes, with SQL*Loader you can do it.
    But first you have to create a Table into your database with columns and datatype matching
    the content of you "csv" file.
    Then, you'll have to prepare a control file and use the option fields terminated by "," as it's
    a "csv" format.
    Then, you could execute your statement.
    Please, find enclosed a link with some example about SQL*Loader and "csv" file:
    [http://www.orafaq.com/wiki/SQL*Loader_FAQ]
    Hope this help.
    Best regards,
    Jean-Valentin

  • SQL* Loader Loading specific column from CSV file to the table

    Dear All,
    Iam Loading specific column from .CSV file to the oracle table.
    Could pls help how i can load only that cols into the table
    Eg: CSV file having id, Frst_name,Last_name, Address,Phone,Insurance etc
    out of this I want to load only Frst_name,Last_name columns to oracle table say fname and lname.
    Thanks in Adv.
    Junu

    Lily,
    I made some changes to your table def but you will get the idea
    -- Table EMPLOYEE
    CREATE TABLE EMPLOYEE
      EMPID        NUMBER                           NOT NULL,
      EMPNICKNAME  VARCHAR2(10 BYTE)                    NULL,
      FNAME        VARCHAR2(20 BYTE)                NOT NULL,
      MI           VARCHAR2(20 BYTE)                    NULL,
      LNAME        VARCHAR2(20 BYTE)                NOT NULL,
      FULLNAME     VARCHAR2(20 BYTE)                NOT NULL,
      HIREDATE     DATE                             DEFAULT SYSDATE               NOT NULL
    --  data file employee.dat
    1,amy,b,amy b
    2,cindy,d,cindy d
    3,eric,f,eric f
    4,gary,h,gary
    -- Control file : Employee.ctl ( you can use truncate, replace or append , see sqlldr for more options)
    load data
    Truncate into table employee
    fields terminated by ","
    optionally enclosed by '"'
    TRAILING NULLCOLS
    empId INTEGER EXTERNAL,
    FName char(20),
    LName char(20),
    FullName char(30)
    now to load use following or you can speicify infile in control fle
    sqlldr username/passowrd control=employee.ctl  data=employee.dat log=employee.log
    {code}
    Hope this help.
    Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Re: FOC- FREE OF CHARGE MATERIAL IN CONSIGNMENT

    Dear Experts, Good Morning to you, When i am doing fixing the stock code for a (FOC-FREE OF CHARGE) material in Consignment when raising Sales order till end of key-in all fields there was no errors but when i was saving the Sales order it was saying

  • App store updates not working in ios7 on 5s

    When I go to updates in the App Store app, and press the update button, it is now opening the app rather than updating it.  If I search for the app and click the icon it installs/updates it.

  • N8 FM Radio Widget: how to get it?

    I have a very useful on my second homepage on N8: a widget of my FM Radio. It's a widget o, with a small radio icon on the left, the double < and > for zapping between the stored stations and in the middle between them a small loud speaker symbol for

  • Xperia U ICS update

    Is it possible to update Xperia U purchased from Oman in India ? The SI number is 1261-8744. When the phone is connected to PC Companion or Update Service it shows "Your phone is already up to date." Please let me know about the update if it is launc

  • Interactive report--hide statement?

    hi I am making an interactive report,but my hide statement is not working.my code is like: START-OF-SELECTION.   SELECT matnr          mtart          matkl   INTO CORRESPONDING FIELDS OF TABLE itab1   FROM mara  WHERE matnr IN p_matnr.   WRITE:/4 'Ma