SQL loader import issue..

Hi,
I am working on 10g database on ibm AIX ..
i need to use sql loader and insert some data in to table using a input file.
The input file contains follwing format..- data.dat
001 901 200 1611196 "dis
ltype
gu" Mhamicddu kuasa 12as king
all these values are tab deliminated and one column value "disltypegu" is enclosed by " " and in next line. This "disltypegu" shuld be inserted in to one column.
I am using following control file..
LOAD DATA
INFILE '/home/oracle/data.dat'
INSERT INTO TABLE emp
(e1,e2,e3,e4,e5,e6,e7,e8,e9)
any idea ...wht all things i need to include in my control file to perform this insert...
I am using below control file ..
LOAD DATA
INFILE '/home/oracle/data1.csv'
APPEND
INTO TABLE emp
FIELDS TERMINATED BY X'09'
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(ename,edd,emob)
By using this control file , we can import tab delemenated and enclosed by "" column ...it is working ..
Only thing is if some column data is in next row , it is treating it as a second row and inserting in to new row..
How to insert data in to one row..
This is my data file ... with 3 column values .. ( ename -Robin , edd - Address , emob - 13)
Robin "Address"
13
but it is inserting emob value (13) in ename ...like next line as a new row...

oradba11 wrote:
Hi,
I am working on 10g database on ibm AIX ..
i need to use sql loader and insert some data in to table using a input file.
The input file contains follwing format..- data.dat
001 901 200 1611196 "dis
ltype
gu" Mhamicddu kuasa 12as king
all these values are tab deliminated and one column value "disltypegu" is enclosed by " " and in next line. This "disltypegu" shuld be inserted in to one column.
I am using following control file..
LOAD DATA
INFILE '/home/oracle/data.dat'
INSERT INTO TABLE emp
(e1,e2,e3,e4,e5,e6,e7,e8,e9)
any idea ...wht all things i need to include in my control file to perform this insert...
I am using below control file ..
LOAD DATA
INFILE '/home/oracle/data1.csv'
APPEND
INTO TABLE emp
FIELDS TERMINATED BY X'09'
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(ename,edd,emob)
By using this control file , we can import tab delemenated and enclosed by "" column ...it is working ..
Only thing is if some column data is in next row , it is treating it as a second row and inserting in to new row..
How to insert data in to one row..
This is my data file ... with 3 column values .. ( ename -Robin , edd - Address , emob - 13)
Robin "Address"
13
but it is inserting emob value (13) in ename ...like next line as a new row...How is this data file created and what processes (automated AND manual) does it pass through before coming to sqlloader? It looks to me like it is getting manually copied and pasted from notepad with line wrap turned on. You really need to address why the data is being wrapped across multiple lines (records).
Edited by: EdStevens on Mar 13, 2012 7:48 AM

Similar Messages

  • SQL*Loader Import Problem

    Hi,
    I am trying to import some data from .txt file to a table in Oracle DB using TOAD- Sql*Loader - Import wizard. I was able to load all the files successfully. All the files are pipe(|) delimited. But in one of the files, when the values for the field is NULL - it is populated as ' ' (space), I have trouble in loading these files.
    Suppose I have the fields f1, f2, f3, f4 in the .txt file. And say I have the data as following (and delimter as pipe(|)):
    f1 f2 f3 f4 f5
    r1|01|xyz|123|abc
    r2|02| |234|bcd * 3rd column being null(space)
    r3| |sam|345|def * 2nd field being null(space)
    |04|ram|456|efg * 1st field being null(space)
    |05|abc|567|gef * 1st column being null
    I have problems loading the records 4,5 using Sql*loader, as the first field being null, the data is not being loaded properly. Is there any alternative way of loading this file into my table. Please help me.

    Pl post OS and database versions, along with the contents of the loader control file and the loader log file with the errors.
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_field_list.htm#i1009544
    HTH
    Srini

  • Sql loader syntax issue

    SQL*Loader: Release 11.1.0.7.0 - Production on Thu Mar 18 07:21:37 2010
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    SQL*Loader-350: Syntax error at line 1.
    Expecting keyword LOAD, found "ÐÏ".
    ÐÏࡱá
    ^
    My sqlldr file looks like this:
    sqlldr control=C:\data\ctl\ss.ctl log=C:\data\logs\ss.log userid=User/Password errors=999 discard=C:\data\discard\ss.dis
    control file looks like this:
    LOAD DATA
    INFILE 'C:\data\SS.TXT' "STR '\r\n'"
    REPLACE
    INTO TABLE SS
    FIELDS TERMINATED BY ';'
    TRAILING NULLCOLS
    ACCOUNT_NBR CHAR,
    ADDR1 CHAR,
    ADDR2 CHAR,
    ADDR3 CHAR,
    ADDR4 CHAR,
    CITY CHAR,
    STATE CHAR,
    ZIPCODE CHAR ,
    more columns all of the are the same syntax column name and char
    I can load this table using the enterprise manager but when using the sqlldr its not working.
    Anything stand out?
    Edited by: mlojan on Mar 18, 2010 5:33 AM

    Only thing I can think of is there is some character set issue between the control file and the operating syste/oracle server.
    You did you create the control file using a text based editor such as notepad or wordpad didn't you? You haven't used something like MS Word?

  • SQL LOADER Import

    Hello
    So I have a export from a MYSQLl database a .sql file that I would like to import into oracle. Can I do that without creating a control file? Would I have to creat a control file for every table that is in the database?
    Brian Sims

    Hi Brian,
    when you don't have a control file the defaults will be used and the defaults commonly don't work in general. As you can imagine every table has its own data types which commonly requires a dedicated control file for every table.
    There's a dedicated SQL*Loader forum and they might be able to assist you to automate the process
    Export/Import/SQL Loader & External Tables

  • How to filter some illegal rows when SQL Loader import data

    I want to import data in a csv file by SQL Loader.
    but , I don't want to import some illegal rows
    when the column 'name' is null
    how can I modify the SQL Loader ctrl file?

    Hi,
    refer this blogpost:
    http://gennick.com/allnull.html
    thanks,
    X A H E E R

  • SQL*Loader Date issue

    How do i get sql loader to recognize recognize AM/PM. My control file is below. The error I get is syntax error at line 14. Expecting field-name, found ")".
    OPTIONS ( SKIP=0)
    LOAD DATA
    INFILE '/ftp_data/labor_scheduling/kronos_punch_temp/kronos_punches.csv'
    BADFILE '/ftp_data/labor_scheduling/kronos_punches/kronos_punches.bad'
    DISCARDFILE '/ftp_data/labor_scheduling/kronos_punches/kronos_punches.dsc'
    INTO TABLE "STAFFING"."KRONOS_TEMP_PUNCHES"
    TRUNCATE
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    (EMPLOYEE_ID,
    SCHEDULE_DATE DATE "MM/DD/YY",
    PUNCH DATE "MM/DD/YY HH:MI AM"
    )

    Hi Gary,
    Could your problem be with this?
    (EMPLOYEE_ID,You have no data type for that field.
    Regards
    Peter

  • SQL*Loader-500 Issue

    Hello
    Using Oracle 11g, I am trying to load a table from data in csv files with oracle SQL Loader,
    table : purchase
    control file : purchase.ctl
    Even if I am giving the right path for control file I still get the error :
    SQL*Loader-500: Unable to open file (purchase.dat)
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: The system cannot find the file specifiedSo why is SQL Loader looking for the file purchase.dat??
    Any help is appreciated

    Talend is the right solution to load data. Now about your problem, have you configured Talend in order to transfer the data? Because Talend can easily transfer the files.
    Maybe you might be able to go to the Talend website to get more information there: http://www.talend.com/

  • SQL*Loader permission issue?

    I have set up a run_all script on LINUX to invoke SQL*Loader for each table to be loaded. I can run this as the Oracle owner just fine. When I try to let the developer run this on dev, they get the following:
    SQL*Loader: Release 9.2.0.1.0 - Production on Tue Apr 25 08:55:18 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    SQL*Loader-128: unable to begin a session
    ORA-01034: ORACLE not available
    ORA-27121: unable to determine size of shared memory segment
    Linux Error: 13: Permission denied
    They can use SQL*Plus on the command line with the userid and password from the SQL*Loader file. I don't want to have to run these for them every time, so any help or ideas would be greatly appreciated!

    Hi
    Has the same ORACLE_HOME variable value of the Oracle owner and the developer?
    Ott Karesz
    http://www.trendo-kft.hu

  • SQL*Loader output issue

    Hi,
    When I load a flat file with SQL*Loader (V 8.1.7 on Windows), I get output something like,
    Commit point reached - logical record count 2352
    Commit point reached - logical record count 2364
    Commit point reached - logical record count 2376
    Commit point reached - logical record count 2388
    Commit point reached - logical record count 2400
    If I want to change this, say I want this message for each 1000 records inserted, how can I do that?
    I have tried options line bindsize or rows, but looks like they are for changing internal operation, but not this screen output.
    Off course, I am talking about conventional path load.
    Any ideas?
    Thanks

    set rows=1000 and increase the bindsize drastically.
    From the docs here
    If that size fits within the bind array maximum, the load continues--SQL*Loader does not try to expand the number of rows to reach the maximum bind array size. If the number of rows and the maximum bind array size are both specified, SQL*Loader always uses the smaller value for the bind array.

  • SQL*LOADER connection issue

    I have oracle 9i installed, if i'm to connect to the database using the sys account i getv a message saying have to connect as sysdba or sysoper. Ok so i use "username/password@database as sysdba", and that works fine i'm able to connect. But this does not work at the inital login screen, i have to connect as using this other account i created then log in useing the string above. My problem is now im using SQL*LOADER to load data into a table and it won't accept the connection string. If it use that connction string listed above i get the error "ORA-12154:could not resolve service name" and if i remove "as sysdba" from the end of the string i get error "ORA-01017: invalid username/password". I use to be able to just log on with just "sys" username is there any way to change it back or any other way to log on to SQL*LOADER. Any help would be appreciated. Thanks

    When you are working with SQL*Loader, SQL*Plus and other utilities you can specify what is the database to be connected through local naming (client, server ) or seeting an enviroment variable in the session. If you are getting connection in the server and you have problems resolving local naming, I recommend you to do this:
    1.- Set the ORACLE_SID enviroment variable and do not use local naming resolving with tnsnames.ora entries
    2.- Configure very well the tnsnames.ora & sqlnet.ora files to get connection.
    If you are working directly in the server the first option is easier.
    Setting the variable in Windows:
    SET ORACLE_SID=<database_sid>
    Setting the variable in Unix/Linux:
    export ORACLE_SID=<database_sid>
    if you need more help to do this step by step I can help you.
    Joel Pérez

  • Sql loader -  to_date() issue

    How do I load the date field from the CSV *"03-Dec-09 10.06.58.00 PM"* into oracle tables using sql loader ?
    The contol file is as follows:
    LOAD DATA
    INTO TABLE
    CUSTOMER
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (CUST_ID,
    ORDER_DATE "to_date(:ORDER_DATE, 'DD-MON-YY HH:MI:SS.TT AM')"
    but it doesn't work, I also tried _ORDER_DATE "DD/MM/YYYY"_ with no luck, any suggestion ?
    I am kind of new in using SQL LOADER.
    thanks.

    The CSV sample you provided uses " *.* " in the time-component [ 10.06.58.00 ] while your SQL Loader Control file is expecting " *:* " [ HH:MI:SS.TT ]. These two formats are obviously not the same. Update your control file and try again.
    CUST_ID, ORDER_DATE
    1,03-Dec-10 10.06.58.00 PM
    2,03-Dec-09 10.07.18.00 PM
    3,03-Dec-11 04.07.18.00 AM
    4,01-Dec-07 10.07.18.00 PM
    5,03-Dec-10 10.07.18.00 AM
    6,12-Dec-10 10.07.18.00 PM
    CONTROL FILE Which "doesn't work "
    LOAD DATA
    INTO TABLE
    CUSTOMER
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (CUST_ID,
    ORDER_DATE "to_date(:ORDER_DATE, 'DD-MON-YY HH:MI:SS.TT AM')"
    {code}
    Edited by: user130038 on Sep 9, 2011 6:56 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • SQL Loader format issue

    Hello,
    I'm having an issue with the formatting of a date. My csv file, exported from another ora table, has the date in full date format ()
    I get the error:
    Record 12: Rejected - Error on table LOAN_VER_REQ_ARCH, column ORIGINATION_DATE.
    ORA-01843: not a valid monthand two other fields that are date fields get similar errors.
    Dates in .csv file appear as such:
    For example - 10/26/2001 0:00:00
    The question is in my ctl file, how do I format?
    I've tried to_char(ORIGINATION_DATE,'MM-DD-YYYY') or
    to_date(ORIGINATION_DATE,'MM-DD-YYYY') These dont' work. I don't recall doing any of this stuff in Ora 9i, but perhaps I wasn't loading date fields before in any tables I uploaded data into.
    Any tips would be appreciated. I get a message on the command prompt about:
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 39
    Commit point reached - logical record count 78but that's incorrect because no records are going into the table. I'll worry about that part later though if I can get this date thing resolved.
    Thanks!

    user515689 wrote:
    Hello,
    I'm having an issue with the formatting of a date. My csv file, exported from another ora table, has the date in full date format ()
    I get the error:
    Record 12: Rejected - Error on table LOAN_VER_REQ_ARCH, column ORIGINATION_DATE.
    ORA-01843: not a valid monthand two other fields that are date fields get similar errors.
    Dates in .csv file appear as such:
    For example - 10/26/2001 0:00:00
    The question is in my ctl file, how do I format?
    I've tried to_char(ORIGINATION_DATE,'MM-DD-YYYY') or
    to_date(ORIGINATION_DATE,'MM-DD-YYYY') These dont' work. I don't recall doing any of this stuff in Ora 9i, but perhaps I wasn't loading date fields before in any tables I uploaded data into.
    Any tips would be appreciated. I get a message on the command prompt about:
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 39
    Commit point reached - logical record count 78but that's incorrect because no records are going into the table. I'll worry about that part later though if I can get this date thing resolved.
    Thanks!Well, the sample string you've provided doesn't match the formats you've been attempting to use. Yours are separated with a hyphen whereas your sample data is separated by a slash.
    Is ALL the data in the same format?
    If so, perhaps this (based on your sample string)....
    TUBBY_TUBBZ?select to_date('10/26/2001 0:00:00', 'mm/dd/yyyy HH24:MI:SS') from dual;
    TO_DATE('10/26/20010
    26-OCT-2001 12 00:00
    1 row selected.
    Elapsed: 00:00:00.01As for specifying this in the control file
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch09.htm#1011137
    (you mentioned Oracle 9, so i'm not sure if that's the version you are still on or not).
    Edited by: Tubby on Jul 27, 2010 11:50 AM
    Added link to documentation.

  • SQL*Loader importing problem, with file with eastern european files

    Hello,
    on Oracle 11g with UTF-8 encoding, I tried to import a csv file into a table via sqlload, the separator is the semicolon ";" all work fine except for some lines witch are not well integrated (the concerned files come from Eastern European countries like Bulgary, Hungary and Czech Republic).
    For example:
    For:
    text_1; text_2; text_with_char_at_end_like_š; new_text
    during the integration instead of have:
    | text_1 | text_2 | text_with_char_at_end_like_š| new_text |
    I got:
    | text_1 | text_2 | text_with_char_at_end_like_š; new_text | null |
    does anyone has this problem, I tried to change the delimiter by code X'59', specified in sqlldr ENCODING UTF8 ... but it does not work
    do you have an idea about this problem
    Thank you in advance

    Thanks,
    the problem was solved since, the file was not in UTF8 format (for example GREEK FORMAT) and the NLS_LANG was AMERICAN_AMERICA ASCII
    then i translate all files to UTF 8 and changed the NLS_LANG to UtF8.
    Regards

  • How to load XML file to table (non-XML) with SQL*Loader -- issue with nulls

    I have been attempting to use SQL*Loader to load an XML file into a "regular" Oracle table. All fields work fine, unless a null is encountered. The way that nulls are represented is shown below:
    <PAYLOAD>
    <FIELD1>ABCDEF</FIELD1>
    <FIELD2/>
    <FIELD3>123456</FIELD3>
    </PAYLOAD>
    In the above example, FIELD2 is a null field and that is the way it is presented. I have searched everywhere and have not found how I could code for this. The issue is that if FIELD2 is present, it is coded like: <FIELD2>SOMEDATA</FIELD2>, but the null is represented as <FIELD2/>. Here is a sample of the control file I am using to attempt the load -- very simplistic, but works fine when fields are present:
    load data
    infile 'testdata.xml' "str '<PAYLOAD>'"
    TRUNCATE
    into table DATA_FROM_XML
    FIELD1 ENCLOSED BY '<FIELD1>' AND '</FIELD1>',
    FIELD2 ENCLOSED BY '<FIELD2>' AND '</FIELD2>',
    FIELD3 ENCLOSED BY '<FIELD3>' AND '</FIELD3>')
    What do I need to do to account for the way that nulls are presented? I have tried everything I could glean from the web and the documentation and nothing has worked. Any help would be really appreciated.

    I hadn't even got that far. can you direct me to where the docs are to import data that is stored within xml but that you don't need any xml functionality, that just happens to be the format the data is stored in? thx

  • How to export&import data using sql *loader

    Hi all,
    How to export&import data from sql*loader. Give me the clear steps..
    Thanks in Advance

    Hi did you already exported data from SQL SERVER? if not using SQL*LOADER you cannot export data. SQL*LOADER is only mean for importing data from flat files(usually text files) into ORACLE tables.
    for importing data into oracle tables using sql*loader use below steps
    1) create a sql*loader control file.
    it looks like as follows
    LOAD DATA
    INFILE 'sample.dat'
    BADFILE 'sample.bad'
    DISCARDFILE 'sample.dsc'
    APPEND
    INTO TABLE emp
    TRAILING NULLCOLS
    or for sample script of control file search google.
    2) at command prompt issue following
    $ sqlldr test/test
    enter control file=<give control file name which you create earlier>
    debug any errors (if occured)

Maybe you are looking for

  • How to fix EXC_BAD_ACCESS error? I just upgraded to 10.7.5 and now I can't open any MS Word documents

    How to fix EXC_BAD_ACCESS error? I just upgraded to 10.7.5 and now I can't open any MS Word documents. I get this error message every time: Microsoft Error Reporting log version: 2.0 Error Signature: Exception: EXC_BAD_ACCESS Date/Time: 2013-05-28 02

  • HT1386 HOW DO YOU DISPLAY DUPLICATES IN PLAYLISTS?

    How do you display duplicates on the playlist with the new itunes format?

  • Connecting my samsung jet s8000 to btfon

    can anybody tell me how to connect my mobile phone to btfon/openzone when on the move outside of my home. thank you. i have no trouble connecting to my bt homehub while i am at home.

  • Return delivery to import vendor

    Hi all, I have Created an 1.) Import PO. 2.)custom Miro done 2.) GRN done at Port Plant 3.) Created a STO and recived material at working Plant 4.) Invoice verification done Now,I want to return a material to import vendor, what will be the steps to

  • Stuck in emergency mode

    I am a Volunteer here, not employed by HP. You too can become an HP Expert! Details HERE! If my post has helped you, click the Kudos Thumbs up! If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you