SQL Loader: Null value in column

Have a tab delimited file, in UNIX
Some of the inbetween columns have null values
The records are failing to load with null column values.
I tried:
col10 nullif col10 ="(null)"
My control file is:
load data
infile 'abc.txt'
into table XX_data
fields terminated by X'09' optionally enclosed by '"'
TRAILING NULLCOLS
( col1,
col2 nullif col2 ="(null)",
col3)

Sample data is tab delimited file. For some reason, it has problem reading the second date (+time) column in the same record when there are null values in preceding columns. It says:
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
Col1     Col2     Col3     Col4     Col5     Col6     Col7     Col8     Col9     Col10     Col11     Col12
2000-01-03 10:38:05.733000000          XX AA Change     0     DOG     CAT     R     2000-01-03 10:38:05.733000000     GIRAFFE          MONKEY     COW

Similar Messages

  • SQL Loader Null Value for Date

    Dear buddies,
    This is how my date column is in my control file.
    dtEdu timestamp(6) with local time zone "YYYY-MM-DD HH24:MI:SS"  "nvl (to_date (:dtEdu, 'YYYY-MM-DD HH24:MI:SS'), to_date ('1982-03-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'))",  The problem is some of the columns in dtEdu has NULL values and I couldn't load them.
    So, trying to replace it with something else.
    Could someone help me?
    Thanks a lot.
    Nith

    >
    The problem is some of the columns in dtEdu has NULL values and I couldn't load them.
    >
    I don't know how your so called "NULL" values look like, but if the null data is actually made up of blanks, try adding LTRIM() around :dtEdu.

  • Sql loader - mutiple values into one column

    Hi,
    Is it possible to load multiple fields into one column. Eg, my table structure has two columns COL1, COL2 and my data file is comma delimted with 3 fields A,B,C.
    How could i use sql loader to achieve (without the use of temp tables)
    COL1 = A
    COL2 = BC
    Thanks

    I don't understand why you can't modify the input fille.
    But anyway, i have 2 ways to help you
    1. Make new inputfile online using pipe and awk(or something your are familiar with) and use it as new input file.
    This is a traditional and powerful method in Unix environment.
    For instance:
    oracle> $ mknod pipe.dat p
    oracle> cat input.dat | awk '{print ...}' > pipe.dat &
    oracle> sqlldr ctl=.. data=pipe.dat
    Using this method, you don't need to modify original input file physically, but by some magical trick you can modify it on the fly.
    2. Use before trigger
    For instance:
    create table load(a int, b int, c int, d int);
    create or replace trigger load_trigger
    before insert on load
    for each row
    begin
    :new.d := :new.b + :new.c;
    :new.b := null;
    :new.c := null;
    end;
    load data
    infile *
    append
    into table load
    fields terminated by "," optionally enclosed by '"'
    (a, b, c)
    begindata
    1, 1, 1
    2, 2, 2
    3, 3, 3
    4, 4, 4
    sqlldr userid=... ctl=load.ctl
    SQL> select * from load;
    A B C D
    1 2
    2 4
    3 6
    4 8
    You won't like the existence of unnecessary columns(B, C) but don't have choice. ^^;
    I think there is another simple way provided by SQL*Loader. But i've never tried it myself. Read following doc and try it yourself:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1008153

  • Loading Null values from source to target

    Hello all,
    Please help me in this issue....
    I am trying to load data from source ( state column, varchar50) into target (state column,varchar10).....
    in my source i have 10records for state...... 9states with lenght<10 and 1 NULL value......
    when i am trying to load the records from source to target...i am getting this error.....
    12899 : 72000 : java.sql.SQLException: ORA-12899: value too large for column "TARGET"."STATE" (actual: 11, maximum: 10)
    why is taking the lenght of NULL as 11...........
    Thanks

    there might be some special characters or international characters instead of Varchar2(10 byte ) try varchar2(10 char) and try again. As some of the unicode symbols or characters can take two byes even though they are single characters

  • External tables in Oracle 11g database is not loading null value records

    We have upgraded our DB from Oracle 9i to 11g...
    It was noticed that data load to external tables in 9i is rejecting the records with null columns..However upgrading it to 11g,it allows the records with null values.
    Is there are way to restrict loading the records that has few coulmns that are null..
    Can you please share if this is the expected behaviour in Oracle 11g...
    Thanks.

    Data isn't really loaded to an External Table. Rather, the external table lets you query an external data source as if it were a regular database table. To not see the rows with the NULL value, simply filter those rows out with your SQL statement:
    SELECT * FROM my_external_table WHERE colX IS NOT NULL;
    HTH,
    Brian

  • SQL Loader null- BLOB

    Hello,
    I'm having a lot of problems to load a null value to a BLOB field via SQL Loader.
    In my file tehre's a blank in the place corresponding to the BLOB field
    , "ACCESS_IMAGE_DATA" CHAR NULLIF ("ACCESS_IMAGE_DATA"=BLANKS)
    then I execute succesfully SQL Loader but in the BLOB field, I get something that is not null
    select (ACCESS_IMAGE_DATA)from TABLE
    ACCESS_IMAGE_DATA
    (BLOB)
    (BLOB)
    (BLOB)
    (BLOB)
    (BLOB)
    (BLOB)
    (BLOB)
    instead of null, null, null....
    Any idea?
    thanks in advance
    Message was edited by:
    user646394

    You have not indicated the front-end tool you are using but it is not SQL*Plus and you are not looking at what you assume you are seeing. Front-end tools do not display BLOBs.
    Run the following query:
    SELECT dbms_lob.getlength(access_image_data)
    FROM <table_name>;If it returns zero then you've been chasing the wind.

  • SQL Loader- Default value is not inserted in table by direct method

    Hi All,
    I am trying to load data from a file to a table by SQL Loader. There is a particular date column which I am not loading from the File but have used a Default constraint to put SYSDATE in it. When I am using direct method load then it is not inserting nothin in this column but in conventional method it is inserting SYSDATE. But I want to do the load by direct method. Can anybody provide me a solution as how to load default value in direct method?
    Thanks & regards.
    Sudipta

    For this special case, you can specify:
    column_name SYSDATE
    in your SQL*Loader control file.

  • URGENT: Problems Loading files with SQL Loader into a BLOB column

    Hi friends,
    I read a lot about how to load files into blob columns, but I found errors that I can't solve.
    I've read several notes in these forums, ine of them:
    sql loader: loading external file into blob
    and tried the solutions but without good results.
    Here are some of my tests:
    With this .ctl:
    LOAD DATA
    INFILE *
    INTO TABLE mytable
    REPLACE
    FIELDS TERMINATED BY ','
    number1 INTEGER EXTERNAL,
    cad1 CHAR(250),
    image1 LOBFILE(cad1) TERMINATED BY EOF
    BEGINDATA
    1153,/opt/oracle/appl/myapp/1.0.0/img/1153.JPG,
    the error when I execute sqlldr is:
    SQL*Loader-350: Syntax error at line 9.
    Expecting "," or ")", found "LOBFILE".
    image1 LOBFILE(cad1) TERMINATED BY EOF
    ^
    What problem exists with LOBFILE ??
    (mytable of course has number1 as a NUMBER, cad1 as VARCHAR2(250) and image1 as BLOB
    I tried too with :
    LOAD DATA
    INFILE sample.dat
    INTO TABLE mytable
    FIELDS TERMINATED BY ','
    (cad1 CHAR(3),
    cad2 FILLER CHAR(30),
    image1 BFILE(CONSTANT "/opt/oracle/appl/myapp/1.0.0/img/", cad2))
    sample.dat is:
    1153,1153.JPEG,
    and error is:
    SQL*Loader-350: Syntax error at line 6.
    Expecting "," or ")", found "FILLER".
    cad2 FILLER CHAR(30),
    ^
    I tried too with a procedure, but without results...
    Any idea about this error messages?
    Thanks a lot.
    Jose L.

    > So you think that if one person put an "urgent" in the subject is screwing the problems of
    other people?
    Absolutely. As you are telling them "My posting is more important than yours and deserve faster attention and resolution than yours!".
    So what could a typical response be? Someone telling you that his posting is more important by using the phrase "VERY URGENT!". And the next poster may decide that, no, his problem is evern more import - and use "EXTREMELY URGENT!!" as the subject. And the next one then raises the stakes by claiming his problem is "CODE RED! CRITICAL. DEFCON 4. URGENT!!!!".
    Stupid, isn't it? As stupid as your instance that there is nothing wrong with your pitiful clamoring for attention to your problem by saying it is urgent.
    What does the RFC's say about a meaningful title/subject in a public forum? I trust that you know what a RFC is? After all, you claim to have used public forums on the Internet for some years now..
    The RFC on "public forums" is called The Usenet Article Format. This is what it has to say about the SUBJECT of a public posting:
    =
    The "Subject" line (formerly "Title") tells what the message is about. It should be suggestive enough of the contents of the message to enable a reader to make a decision whether to read the message based on the subject alone. If the message is submitted in response to another message (e.g., is a follow-up) the default subject should begin with the four characters "Re: ", and the "References" line is required. For follow-ups, the use of the "Summary" line is encouraged.
    =
    ([url http://www.cs.tut.fi/~jkorpela/rfc/1036.html]RFC 1036, the Usenet article format)
    Or how about [url http://www.cs.tut.fi/~jkorpela/usenet/dont.html]The seven don'ts of Usenet?
    Point 7 of the Don'ts:
    Don't try to catch attention by typing something foolish like "PLEASE HELP ME!!!! URGENT!!! I NEED YOUR HELP!!!" into the Subject line. Instead, type something informative (using normal mixed case!) that describes the subject matter.
    Please tell me that you are not too thick to understand the basic principles of netiquette, or to argue with the RFCs that governs the very fabric of the Internet.
    As for when I have an "urgent" problem? In my "real" work? I take it up with Oracle Support on Metalink by filing an iTAR/SR. As any non-idiot should do with a real-life Oracle crisis problem.
    I do not barge into a public forum like you do, jump up and down, and demand quick attention by claiming that my problem is more important and more urgent and more deserving of attention that other people's problem in the very same forum.

  • Grand Total with few NULL values in column.

    Hi All,
    In my requirement, I have few null values in the column and I have to show those null values as it is( can't use IfNull function).
    Can I able to grand total in such scenerio..?
    I am using OBIEE 11.1.1.3
    Thanks,
    Archie

    HI Archie,
    Are you using the "Grand Total" option that comes with the view?.I don't think there will be any issue , it will ignore the null values while calculating the total.
    Rgds,
    Dpka

  • How to replace null value, if column is text and not numeric in OBIEE?

    Hi,
    Please note that I had tried to change the null text by adding bin value for Unspecified and Unknown but this did not work for me.. not sure if I am missing out to put anything in value filter…
    Thank You,
    Ravi

    Check this function:
    http://docs.oracle.com/cd/E23943_01/bi.1111/e10544/appsql.htm#CHDHJABI
    Cheers
    Nico
    IFNULL
    This function tests if an expression evaluates to a null value, and if it does, assigns the specified value to the expression.
    Syntax
    IFNULL(expr, value)
    Where:
    expr is the expression to evaluate.
    value is the value to assign if the expression evaluates to a null value.

  • 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

  • SQL*Loader concat into one column

    Hi
    I want to import an ASCII File with fixed positions to a table. One column in database needs 3 different position strings to import. is there a way to do it?
    i test this sample, but it doesn't work:
    into table t1
    ORDER position(1:10),
    NAME position(28:35)||' '||position(100:116)||', '||position(129:140)
    ralf

    ok forget it. I've just see the answer in forum. SORRY

  • SQL Loader-How to insert -ve & date values from flat text file into coloumn

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide.

    Question: How to insert -ve & date values from flat text file into coloumns in a table.
    Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
    How to load such values in columns of database using SQL Loader?
    Please guide. Try something like
    someDate    DATE 'DDMMYYYY'
    someNumber1      "TO_NUMBER ('s99999999.00')"
    someNumber2      "TO_NUMBER ('99999999.00s')"Good luck,
    Eric Kamradt

  • Error: SQL Loader-466 column not exist ???

    dear all.
    i have a problem with sql loader.
    The error is:
    SQL*Loader-466: Column NUM_PAQ does not exist in table PLANELEC.file
    i saw desc table:
    SQL> DESC PLANELEC.file
    Nombre ¿Nulo? Tipo
    num_paq NOT NULL CHAR(8)
    formulario NOT NULL CHAR(4)
    norden NOT NULL NUMBER(38)
    cod_docide_dec NOT NULL NUMBER(38)
    num_docide_dec NOT NULL VARCHAR2(11)
    num_correl_a NOT NULL NUMBER(38)
    cod_docide_aseg NOT NULL NUMBER(38)
    num_docide_aseg NOT NULL VARCHAR2(15)
    cod_cat_tra NOT NULL NUMBER(38)
    cod_tipo NOT NULL NUMBER(38)
    fec_ini_perlab NOT NULL DATE
    fec_fin_perlab DATE
    cod_extincion CHAR(2)
    ind_envio NUMBER(38)
    fec_envio DATE
    num_ctl CHAR(6)
    my ctl file is:
    Load DATA
    INFILE file.UNL
    INSERT
    INTO TABLE PLANELEC.file
    fields terminated by '|'
    TRAILING NULLCOLS
    NUM_PAQ,FORMULARIO,NORDEN,COD_DOCIDE_DEC,NUM_DOCIDE_DEC,NUM_CORREL_A,COD_DOCIDE_ASEG,
    NUM_DOCIDE_ASEG,COD_CAT_TRA,COD_TIPO,FEC_INI_PERLAB,FEC_FIN_PERLAB,COD_EXTINCION,
    IND_ENVIO,FEC_ENVIO,NUM_CTL
    and the first line of the file.unl is:
    00000000|0601|2000043|6|20100066603|1|1|90000001|1|20|01/02/2002|||0||613954|
    what could be the problem with that?
    thanks a lot !
    cesar
    ORACLE 10GR2
    RHEL AS V4.0

    Hi ThinkingEye,
    Please check the definition of the control file. Did you for instance inclose the file name in quotes?
    That's usually the reason for the 466 error with SQL*Loader.
    Also check column definitions and column formats that are in the definition.
    Cheers, Patrick
    ps Is this thread related to the other 2 you have with the same target table STG_GEM_EVENT_ITS?

  • Decode Not working in sql loader

    I had a requirement of loading flatfile into staging table using SQL Loader, One of the columns in the the Flat file is having values FALSE or TRUE and my requirement is that I load 0 for FALSE and 1 for TRUE which can be achieved by simple DECODE function...I did use decode and tried to load several times but did not work. What might be the problem
    LOAD DATA
    INFILE 'sql_4ODS.txt'
    BADFILE 'SQL_4ODS.badtxt'
    APPEND
    INTO TABLE members
    FIELDS TERMINATED BY "|"
    ( Person_ID,
    FNAME,
    LNAME,
    Contact,
    status "decode(:status, 'TRUE', '1','FALSE','0')"
    I did try putting a trim as well as SUBSTR but did not work....the cloumn just doent get any values in the output (just null or say free space)
    Any help would be great.....

    Hello user8937215.
    Please provide a create table statement and a sample of data file contents. I would expect DECODE or CASE to work based on the information provided.
    Cheers,
    Luke
    Please mark the answer as helpful or answered if it is so. If not, provide additional details.
    Always try to provide create table and insert table statements to help the forum members help you better.

Maybe you are looking for