Encapsulate data problems when loading with sql loader

Hi all

I use sql loader to load data into a flat file HP UNIX.

I find the fi the NUMBER data type or date type get wraped to the new line, the control file triggered errors.

The data looks like to (field dilimiter is |, record dilimter is ~):

1 A87CCH | 1 A87CCH | PLAN_ACCOUNT_PROMOTION | HIR6A-1 | 20100706 06:06:24 | 1 DNE1 | DC?
2010.7 FY1011 Promoiton | 1 A87AW0 | 1 HJEZE | Private | 20100730 00:00:00 | 00 20100710
: 00:00 | 0 | Completed | 20100730 00:00:00 | 20100710 00:00:00 | 0 | 1 4A6PKP | TFMAAI | N
| 0 | 0 | 0 | 0 | 0 | 0 | 1 4A6PKP | Approved | 1 8U4E-163 | 00:00:20110630 00 |
20100708 01:45:35 | 20100707 00:00:00 | -1||| 0 | 9000 | 0 | 0 ||| 100. N | 0 | 0 | 0 | 0
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | N | 20110426 04:01:34 | 1 8U4E-163 | 0|||||||||
||||| ~


The control file looks like:

OPTIONS (ERRORS = 1000, DIRECT = TRUE, PARALLEL = TRUE, DATE_CACHE = 5000, discardmax = 50)
UNRECOVERABLE
load data
INFILE ' / home/bs7822/leon/leon.dat' "str" ~ "»
BADFILE ' / home/bs7822/leon/leon.bad'
DISCARDFILE ' / home/bs7822/leon/leon.discard'
ADD THE LEON_123456 TABLE
FIELDS TERMINATED BY ' | '. SURROUNDED OF POSSIBLY "" "
TRAILING NULLCOLS
(
X_INTERFACED_DT EXPRESSION "to_date (replace (replace (: X_INTERFACED_DT_BF, chr (10),"), Chr (13), "), 'YYYYMMDD hh24:mi:ss')", "
X_INTERFACED_DT_BF boundfiller,
EXTERNAL DECIMAL X_ACCRUAL_AMT,
X_PLAN_SHIPMENT_PATTERN_ID TANK (90)
)

I think that replace it can treat the wrapped date. But I want to know if we can find a faster or easier way to conquer this topic since the beginning.

Best regards

Leon

user12064076 wrote:
Thank you for your response. But how to ensure that a record is in a single line? For example, to unload data with coil?

The table has more than 100 columns.

Best regards
Leon

UH... which guarantee is implemented by anyone or anything that generates the data in the first place.
for example if I am extracting data to CSV for a customer or another application, making sure that it is 1 card per line with delimiters known etc.

What is your own code that produces the data in the first place? If so, how are you to produce? With large amounts of data I wouldn't do it with SQL * Plus spool command, but I do with UTL_FILE within PL/SQL, or generating data in a file CLOB and spell the CLOB in a go using one of the CLOB methods available writing files.

Tags: Database

Similar Questions

  • Digital Media Designer problem when loading a file?

    Hi I have a problem when I try to bring a media resource to my layout. After I loaded the file to the library I go in the designer to create a presentation then I click on the 'Media' next to the icon icon company TV to add one of the strengths of the library, but it only allows me to select the file. I could select the icon the Playlist file.

    I wonder if this isn't the correct rotation.

    I must say that I just upgraded to 5.2 and I am not familiar with all the features and options.

    I've attached a screenshot of the screen window.

    Thank you

    I believe that it is a known problem and is being implemented.

    The solution that I use is to use the icon for Media selection

    then select the media resource.

    This works...

    See you soon!

    T.

  • Screen problem of refresh with SQL Developer 1.5.5 on Vista 64-bit

    I use the latest version of SQL Developer.

    I have screen refresh issues in sql developer. Scrolling up and down, the screen gets jumbled up, some screen time do any appear. Work with SQL Developer very difficult. I don't have such a problem with any of my other publishers.

    Is this something specific to Vista? Is it someone knows solution to this problem.

    Thank you

    Edited by: user5899685, 1 Sep 2009 11:14

    Specific? Not really, but judging by the posts here Vista is more likely. It usually indicates the incompatibility between Java and video drivers.
    If the update of your JDK or the video driver does not work or is not an option, just disable DirectDraw in \sqldeveloper\bin\sqldeveloper.conf generally also works:

    AddVMOption - Dsun.java2d.noddraw = true

    Hope that helps,
    K.

  • Basic needs when working with SQL/PLSQL on Vmware

    Hello Experts;

    I have two question and I need solutions for this.

    I'm working on vmware (oel 4.4) and 10g r2 (10.2.0.1 and 10.2.0.4) database

    When executing PL/SQL programs (if I get the error) and I have to copy / paste.

    MY QUESTIONS:

    1. How can I change a long program (pl/sql code)?  (ed or anything like that)

    2. as many times I want to set < serverouton set > (to avoid on each session) permanent any solution?

    ex:

    SQL > ed

    A written file afiedt.buf

    26

    Select the name of database v$.

    ?

    ?

    ?

    ?

    ?

    -I do the closing session;


    MY OS details:

    $ uname - a

    Linux linuxserver 2.6.9 - 42.0.0.0.1.ELsmp #1 SMP 14:02:40 PDT Sun 15 Oct 2006 i686 athlon i386 GNU/Linux


    MY VERSION OF DB

    SQL > select * from v version $;

    BANNER

    ----------------------------------------------------------------

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod

    PL/SQL Release 10.2.0.1.0 - Production

    CORE 10.2.0.1.0 Production

    AMT for Linux: Version 10.2.0.1.0 - Production

    NLSRTL Version 10.2.0.1.0 - Production

    some we used set the editor

    You don't need that. Just add 'export EDITOR = vi' the user profile (as said SY), normally .bash_profile on linux.

  • problem when loading data file DB

    Hello

    I am new to ODI,

    I just do a test, loading DB data in the text file, I did encounter a problem,

    a DB table has two columns, ID and NAME,

    I created a text file "TEST.txt", as follows,
    ID NAME
    2B

    I created a logical and physical structure in the topology, and created, last model creates the interface, selected 'LKM SQL SQL' and 'IKM SQL incremental update.

    Then run the interface, it had mistakes, said 7000: null: java.sql.SQLException: ODI-40475: invalid column: C1_ID',.

    I found it will remove the 'TEST.txt', and recreated, but column names have been changed, C1_ID, C2_NAME, IKE

    If so, how can I load table DB file with success and the name of the columns in the DB table were the same as the name of the columns in the file.

    Thank you!

    Hope you have selected "Different from the target of the staging area" and set it to any schema RDBMS?

  • Error data truncated when loading saves waveforms

    Once I recorded a waveform using the 'write waveforms in a file' VI (for example I save it as wave.lvm), I tried to load it using the VI "waveform reading a file. I always get an error about not flattened or truncated data (error 116). Any suggestions?

    Hello boomchild06,

    After having had a detailed look at the various databases that we use, I discovered that it is a known issue with LabVIEW 8.0.

    Workaround was proposed as follows:

    1. place the waveform of File.vi reading on the block diagram and double-click it to open it.
    2. go to the diagram and click twice on the Open create replace WDT DLog File.vi and discovers the block diagram.
    3. navigate into the structures of the case until you see the service to deny access. I suggest you save this VI as something different from this moment on, so that you do not change the screw in the vi.lib folder.
    4. Once you have the re-recorded with a different name, and I would say in a different location, follow the exit of the bunch of the error in the structure of the case that it is connected to. I navigate to the case of fake and then made a right click on the border to eliminate the species.
    5. Once this is done, you can remove the whole box structure. I could recommend this way to avoid a lot of painful rewiring.
    6. Once you have removed, you can remove any broken wires, unbundle function and the function is equal to zero. You can either choose to disable the feature to deny access, to avoid error pop ups.

    Alternatively, the fix has been implemented in LabVIEW 8.0.1 update which is a free patch that can be installed. If you want to go ahead and install this, it can be downloaded from:

    http://digital.NI.com/softlib.nsf/webPreview/4C1209D42320BCFD8625711C005FB25B?OpenDocument

    I hope this helps.

  • Problem when loading a large file

    Oracle 11.2.0 (11g) Windows Server 2008

    It is the first time with Oracle databases.
    We take Oracle courses but we are at the beginning.

    Today, we had a problem and we are trying to understand what happened.
    There is a text file with lines more than 3000000 to load the database.
    The user has started the procedure and everything was fine.
    More than 1000 rows were processed in less than 1 second.
    But suddenly the procedure stopped at line number 694092.
    There is no problem of space in storage and the procedure was running alone. This is the first file that we load, if everything was free.
    We thought it might be an automatic routine to Oracle db, so we leave the load routine the way it was just to see if it ends before Monday.
    We were not running anything else at this time. We have only the "suggested" as automatic routine Oracle backup, but the full backup will be only 10 hours right now. Our archivelog mode. The recover flash is also configured. But these configurations have been made 2 months ago. Maybe our redo log files were not clearly specified by the consultant who has installed the system here 3 months ago. We have 3 files .rdo with 50 MB each. Could be the problem?
    Does anyone have an idea?

    Eduardo

    Hello

    There are a few possibilities...

    1. lack of resources of your machine (can be identified via Enterprise Manager / Grid Control + Manager the performance of your Windows machine).

    2. an outdoor activity that stopped your loading process (can be identified via Enterprise Manager / Grid Control + Manager the performance of your Windows machine).

    3. some Oracle DB problem (can be identified from journal of the alerts/oracle/app/oracle/diag/rdbms/gtdb /track)

    4. some long DB Oracle wait event (can be identified via Enterprise Manager / Grid Control)

    5. some intensive resources Oracle on demand or tasks, for example, optimizer statistics (can be verified via Enterprise Manager - Central Planner).

    Good luck!

    ---------------
    http://DBA-star.blogspot.com/

  • Double-click the problem when loading.

    Hi guys.  My site has been updated and brillianty running, but I just noticed something.  I have my navigation at the top of the page bar.  To load things, I do

    var myMovieClip = new contact_mc();
    var myMovieClip2 = new aboutUs_mc();
    var myMovieClip3 = new Join();
    var myMovieClip4 = new ourWork_mc();
    

    And then

    topNav_mc.addEventListener(MouseEvent.CLICK, gotoFunction);
    function gotoFunction(event:MouseEvent):void
    {
    
        for (var i: int=0; i< container_mc.numChildren; i++)
        {
            var child:DisplayObject = container_mc.getChildAt(i);
            container_mc.removeChild(child);
        }
        
        
        if (event.target.name == "about_mc")
        {
            container_mc.addChild(myMovieClip2);
            TweenLite.from(myMovieClip2, 1, {alpha:0, rotation:15});
    
        }
        if (event.target.name == "contact_mc")
        {
            container_mc.addChild(myMovieClip);
            TweenLite.from(myMovieClip, 1, {alpha:0, rotation:15});
        }
    
        if (event.target.name == "join")
        {
            container_mc.addChild(myMovieClip3);
            TweenLite.from(myMovieClip3, 1, {alpha:0, rotation:15});
        }
    
        if (event.target.name == "work_mc")
        {
            container_mc.addChild(myMovieClip4);
            TweenLite.from(myMovieClip4, 1, {alpha:0, rotation:15});
        }
    
    }
    

    As I say, it works fine.  But I accidentally just clicked a button twice quickly and it makes tweening stop at Midway, and the loaded content becomes semi transparent.  Then I tried clicking the button two times one another, and the same thing happened.  It happens when I click twice on a key very fast pace.

    Is there a reason that this could happen, or is there something in my code that I can do to prevent this?

    Thank you very much

    Nick

    One thing you could do is remove the event listener in the service and then add it after that the call of the Tween is completed.

  • Dell Inspiron N5110 touchpad problem when loading

    Hello

    I have been using my dell inspiron for about a year and a half and it worked fine. But one day, I plugged my charger to charge laptop and the mouse goes Mad... He puts back and forth on its own without me touching it.i google the problem but not found any useful material. I installed the ALPS driver and the only help I get is that I turn my touchpad when supported and use a usb mouse instead.
    Everyone please help.

    thanx.

    Asad.

    Hi Asadmujtaba,

    I sent a request for friend once more. Private to me message serial number.

    Waiting for your answer!

  • HP 15-R262TU: problem when loading windows 7 and dual boot

    Good night make me problems during the installation of windows 7 and fedora, this laptop HP 15-R262TU supports only windows 8.1 and it is suppoting dual boot or not? Please answer soon

    Hello

    Here is the required link for any Windows 7 drivers for your machine, once you have installed Windows 7 goto the link and download all the drivers that are not installed via the Device Manager.  If you make a list of the drivers not installed then please refer to the page pilots and take all the drivers, you need.

    http://support.HP.com/us-en/drivers/selfservice/HP-15-notebook-PC-series/7486447/model/7812714#Z7_3054ICK0KGTE30AQO5O3KA30R1

    Checkurtech

  • Network problems when mixed with computers based XP - Win 7 computer help?

    My network functions end when all computers are based on XP, but when a computer is Windows 7 wireless I discovered only two of three computers. There is no other variables.

    Hello

    Try the methods provided below and check if the problem persists.

    Method 1:

    This problem occurs if the (LLTD) link layer topology discovery Responder component is not installed on the Windows XP computer.

    In order to establish the connection between the windows 7 machine and the Windows XP machine, try to download and install the patch Link-Layer Topology Discovery (LLTD). Click on the link below:

    Link Layer Topology Discovery (LLTD) responder (KB922120)

    http://www.Microsoft.com/downloads/details.aspx?FamilyId=4F01A31D-EE46-481e-BA11-37F485FA34EA&displaylang=en

    Method 2:

    Try the steps in the link below for the network of home computers running different versions of Windows

    Networking of computers running different versions of Windows

    http://Windows.Microsoft.com/en-us/Windows7/networking-home-computers-running-different-versions-of-Windows

     

    Method 3:

    Ping the loopback address to verify that TCP/IP is installed and configured correctly on the local computer. To do this, type the following command:

    Ping 127.0.0.1

    If the loopback test fails, the IP stack is not responding. This problem may occur if one or more of the following conditions are true:

    ·         The TCP drivers are corrupted.

    ·         The network adapter does not work.

    ·         Another service is interfering with IP.

  • Problems when printing with USB or wireless - offline message

    Hello world

    I use a HP ENVY 4500 with a laptop Acer Aspire laptop and a desktop computer HP Pavilion 500, both with an Intel i7 and Windows 8.1. Initially, I configured the printer to work with both PCs wireless. The wireless network is provided by the modem of my provider (Telenet), so it is not very strong I increased it with Devolo powerline adapters. Print is fine, only when I want to print more pages then 3 print job is stopped in the middle of page 4. I get a message that the printer could not print the document, and the page comes out half print. I connected my printer with a USB cable and configured to work with USB, but also wireless. But that Don t always works, today, I tried to print a document from Mozilla Firefox and it would not start. The printer can be used on both sides without choosing the connection?  Also I get the message that the printer is offline and cannot print the document, even if it's actually printing.

    When I open the doctor print & scanning everything seems to be ok wth the printer, no defects are detected. Wrong me?

    Hello @DenOuwe and welcome to the Forums of HP, I hope you enjoy your experience!

    I see that you run into connectivity errors.  I would like to help.

    I would recommend using this thread on missing/partial prints & printer offline on Windows 8/8.1. by @JERENDS

    Good luck and please let me know the results of your troubleshooting operations. Thanks for posting on the HP Forums!

  • Problem when using with native document as cdf

    Hay
    I am trying to use the native document as cdf to be simple without defining converters.
    I have a space reserved in my page which was asigned to the native document.
    My goal sound in order to display a web native documant(like word) view html.

    My problem its that I got this error:
    «Caused by: oracle.stellent.ridc.protocol.ServiceException: cannot download "ERANTEST".» Cannot export the document 'ERANTEST' using the '(null)' model and layout '(null) '. "Export process: 'hcexport'"

    Can we have an idea for this problem?

    Note: I have another application that is running in a different environment that work very well except Hebrew problem.

    Thank you
    Eran z

    Hey Eran,

    Root cause of this problem:
    ----------------------------------

    In a windows-based cluster environment intradoc.cfg had weblayout and horse-Saltire pointing to the shared file system UNC path. This is a known bug / problem with the cluster environment where in the indexer would fail.

    Also here the same question was the origin of the problem where in the files being checked are unable to get indexed by the UNC path for the values weblayoutdir and vaultdir in intradoc.cfg.

    Solution:
    -------------

    Map of the shared file system to a drive like Y:/weblayout and Y:/arch letter.

    Use these values in weblayoutdir and vaultdir in intradoc.cfg and restart the server.

    After the re - indexing the entire collection to solve the problem.

    Thank you
    Srinath

  • Problem when working with lists of shuttle at the APEX 3.2

    Hi all

    My requirement is to fill a table DDL SQL is:

    CREATE TABLE 'C_BIA_MOD_PROD_LINE_VER_REL '.
    ("PRODUCT_LINE_VERSION" VARCHAR2 (100) NOT NULL ACTIVATE,)
    ACTIVATE THE "MODULE_CODE" VARCHAR2 (100) NOT NULL,
    ACTIVATE A ("PRODUCT_LINE_VERSION", "MODULE_CODE") PRIMARY KEY CONSTRAINT 'C_BIA_MOD_PROD_LINE_VER_R_PK '.
    )
    ;
    ALTER TABLE 'C_BIA_MOD_PROD_LINE_VER_REL' ADD 'C_BIA_MOD_PROD_LINE_VER_R_FK1' ("MODULE_CODE") FOREIGN KEY CONSTRAINT
    ACTIVATE THE "C_BIA_MODULE" ("MODULE_CODE") REFERENCES;

    ALTER TABLE 'C_BIA_MOD_PROD_LINE_VER_REL' ADD 'C_BIA_MOD_PROD_LINE_VER_R_FK2' ('PRODUCT_LINE_VERSION') FOREIGN KEY CONSTRAINT
    ACTIVATE REFERENCES "C_PRODUCT_LINE_VERSION" ("PRODUCT_LINE_VERSION");
    --------------------------------------------------------
    Now in the form of CREATION of C_BIA_MODULE, I added a region and an element of 'The shuttle list Type' for PRODUCT_LINE_VERSION. For the button CREATE, I prepared the PL/SQL like:

    DECLARE
    prodlinever_selected APEX_APPLICATION_GLOBAL. VC_ARR2;
    BEGIN

    prodlinever_selected: = APEX_UTIL. STRING_TO_TABLE(:P4_PRODUCT_LINE_VERSION);
    BECAUSE me IN 1.prodlinever_selected.count
    LOOP
    INSERT INTO C_BIA_MOD_PROD_LINE_VER_REL (MODULE_CODE, PRODUCT_LINE_VERSION)
    VALUES (: P4_MODULE_CODE, prodlinever_selected (i));
    END LOOP;
    Returns true;
    END;
    ----------------------------------------------------------

    The question is where to use this PL/SQL? The column 'Conditions' under 'Edit Page buttons' does not have this. In addition, the 'action of database' options are not enough to fill a selection in an array of other (C_BIA_MOD_PROD_LINE_VER_REL) as the current page of the table (C_BIA_MODULE). Any other approach? Help, please. Not enough info in the user guide.

    Thank you
    -Marie

    Published by: Mary Agarwal, July 14, 2009 12:26 AM

    Published by: calling Marie on July 22, 2009 22:08

    Mary:

    You can write a pl/sql loop to generate the ':' separated string.
    Something similar to

    str varchar2(2000);
    begin
    for x in (select deptno from emp where not deptno is null) loop
     str:=str || x.deptno || ':';
    end loop;
    
    str := substr(str,1,length(str)-1 );
    end;
    

    CITY

  • Problem with Sql Loader

    Hi s/n,.

    I am facing problems when loading the dates in the database by using sql loader. My data file can have several date formats, so I have a function that interprets date and removes the time settings and the date of return.

    Something like that.

    For example:

    I have a table-

    CREATE TABLE TEMP1234

    (

    IDENTIFICATION NUMBER,

    DATE OF ASOF_DATE

    );

    Data file

    10001172 | 09/12/1945

    Control file:

    OPTIONS (DIRECT = TRUE, SILENT (FEEDBACK) =, skip = 0)

    DATA RELATING TO SUNK COSTS

    REPLACE

    in the temp1234 table

    ' fields completed by "|" possibly provided by ' "'

    TRAILING NULLCOLS

    (ID,

    ASOF_DATE "decode (: ASOF_DATE, null,:ASOF_DATE,conv_date1(:ASOF_DATE))).

    )

    Function CONV_DATE1:

    FUNCTION to CREATE or REPLACE conv_date1 (p_str IN VARCHAR2)
    DATE OF RETURN
    IS
    RETURN_VALUE DATE;

    p_str1 VARCHAR2 (15): = NULL;

    FmtArray TYPE IS a TABLE OF VARCHAR2 (30);

    g_fmts fmtArray
    : = fmtArray ("yyyy-mm-dd",
    "yyyy/mm/dd"
    mm/dd/yyyy"."
    "dd-mm-yyyy",
    "dd/mm/yyyy",
    "mm-dd-yyyy");
    BEGIN
    p_str1: = SUBSTR (p_str, 1, 10);

    BECAUSE me in 1... g_fmts. COUNTY
    LOOP
    BEGIN
    return_value: = TO_DATE (p_str1, g_fmts (i));
    EXIT;
    EXCEPTION
    WHILE OTHERS
    THEN
    NULL;
    END;
    END LOOP;

    IF (return_value IS NULL)
    THEN
    RAISE PROGRAM_ERROR;
    END IF;

    RETURN Return_value;
    END;
    /

    In this case, if the year in the data file shown in 1945, date which is load in the poster 2045 database.

    But when I run this function by putting a sql editor - it returns the correct value.

    Select double conv_date1('12/09/1945');

    Please help me understand what is causing the problem.

    I think there may be an implicit conversion going on with the combination of decode and checking nvl and function within SQL * Loader.  I put the nvl checking in function and simply use the function in the control file, as shown below.

    OPTIONS (DIRECT = TRUE, SILENT (FEEDBACK) =, skip = 0)

    DATA RELATING TO SUNK COSTS

    REPLACE

    in the temp1234 table

    ' fields completed by "|" possibly provided by ' "'

    TRAILING NULLCOLS

    (ID,

    asof_date ' conv_date1 (: asof_date).

    )

    FUNCTION to CREATE or REPLACE conv_date1 (p_str IN VARCHAR2)

    DATE OF RETURN

    IS

    RETURN_VALUE DATE;

    p_str1 VARCHAR2 (15): = NULL;

    FmtArray TYPE IS a TABLE OF VARCHAR2 (30);

    g_fmts fmtArray

    : = fmtArray ("yyyy-mm-dd",

    "yyyy/mm/dd"

    mm/dd/yyyy"."

    "dd-mm-yyyy",

    "dd/mm/yyyy",

    "mm-dd-yyyy");

    BEGIN

    IF p_str IS NULL

    THEN RETURN NULL;

    ON THE OTHER

    p_str1: = SUBSTR (p_str, 1, 10);

    BECAUSE me in 1... g_fmts. COUNTY

    LOOP

    BEGIN

    return_value: = TO_DATE (p_str1, g_fmts (i));

    EXIT;

    EXCEPTION

    WHILE OTHERS

    THEN

    NULL;

    END;

    END LOOP;

    IF (return_value IS NULL)

    THEN

    RAISE PROGRAM_ERROR;

    END IF;

    RETURN Return_value;

    END IF;

    END;

    /

Maybe you are looking for