SQLLDR: How to fill the empty columns with specific data by default?

Hello

We are 11G

Here is a complete example:

(1) the definition of the table:
create table IMPORT_PRJ_TIMESHEETS
(
  RESSOURCE_CODE VARCHAR2(20),
  REFERENCE_DATE VARCHAR2(20),
  STATUS         VARCHAR2(20),
  PROJET_CODE    VARCHAR2(50),
  TACHE_ID       VARCHAR2(100),
  TACHE_DESC     VARCHAR2(250),
  RAF            NUMBER,
  JOUR1          NUMBER,
  JOUR2          NUMBER,
  JOUR3          NUMBER,
  JOUR4          NUMBER,
  JOUR5          NUMBER,
  JOUR6          NUMBER,
  JOUR7          NUMBER,
  IMPORT_DATE    DATE
);
(2) the CTL:
LOAD DATA
CHARACTERSET WE8ISO8859P1
   APPEND INTO TABLE IMPORT_PRJ_TIMESHEETS
-- Pour eliminer la ligne d'en-tete
WHEN PROJET_CODE != 'ID projet'
   FIELDS TERMINATED BY '*-*' OPTIONALLY ENCLOSED BY '"'
( RESSOURCE_CODE       CONSTANT '!RESSOURCE_CODE!'
, REFERENCE_DATE       CONSTANT '!REFERENCE_DATE!'
, STATUS               CONSTANT '!STATUS!'
, PROJET_CODE          CHAR
, TACHE_ID             CHAR
, TACHE_DESC           CHAR
, RAF                  CHAR "TO_NUMBER( :RAF, '999G999D99')"
, JOUR1                CHAR
, JOUR2                CHAR
, JOUR3                CHAR
, JOUR4                CHAR
, JOUR5                CHAR
, JOUR6                CHAR
, JOUR7                CHAR
, IMPORT_DATE          SYSDATE
)
{code}


3) the datafile :
{code}
ID projet*-*ID tâche*-*Tâche/Description*-*RàF*-*lun. 13/07*-*mar. 14/07*-*mer. 15/07*-*jeu. 16/07*-*ven. 17/07*-*sam. 18/07*-*dim. 19/07*-*
FR-FR-NT2300135*-* *-*GAMMAWEB - Coordination*-*0,00*-* *-* *-* *-*8,00*-*8,00*-* *-* *-*
 *-* *-*Holiday*-* *-* *-*8,00*-* *-* *-* *-* *-* *-*
 *-* *-*Special leave*-* *-*8,00*-* *-* *-* *-* *-* *-* *-*
 *-* *-*Vacation*-* *-* *-* *-*8,00*-* *-* *-* *-* *-*

{code}

- As you can see, the datafile delimiter is "*-*" .... there's no pb about this.

- Also, there are 5 lines in the datafile. Currently, the _*load status*_ is :
   - Line 1 is the header  >>> not loaded, and that's fine with me.
   - Line 2 is successfully loaded
   - Line 3 / Line 4 / Line 5 : are not loaded .. but I need these lines ...

*What I'd like to get is to successfully load lines 3 to 5 with a default values for the first 3 columns (project/task ID/ task desc)*

I hope it's clear enough and that you will be able to provide a good answer ..

Thanks in advance,
  Olivier                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

In your example, the only ranked with value on all lines is TACHE_DESC.
If this field is always filled, try this:
WHEN TACHE_DESC! = "Task/Description".

Concerning

Tags: Database

Similar Questions

  • How to fill the new column with values based on the subquery

    How can I fill a new column (teamid) with the following query below, at my table dept? I'm empty/null entries in teamid collar when I run the code ff:

    ALTER table dept add (teamid varchar2 (15));

    Update dept

    define the teamid = select upper (substr (deptname, 1, 3)) | Upper (substr (Color, 1, 2)) | rownum

    of the Department;

    Want to output:

    DEPTNAME COLOR TEAMID
    SALESORANGESALOR1
    ACCOUNTINGBLUEACCBL2
    BILLINGYELLOWBILL3
    SQL> create table dept as
      2  select 'SALES' deptname, 'ORANGE' color from dual union all
      3  select 'ACCOUNTING' deptname, 'BLUE' color from dual union all
      4  select 'BILLING' deptname, 'YELLOW' color from dual
      5  /
    Table created
    
    SQL>
    SQL> select * from dept;
    DEPTNAME   COLOR
    ---------- ------
    SALES      ORANGE
    ACCOUNTING BLUE
    BILLING    YELLOW
    
    SQL>
    SQL> alter table dept add(teamid varchar2(15));
    Table altered
    
    SQL> update dept set teamid = upper(substr(deptname,1,3)) || upper(substr(color,1,2)) || rownum;
    3 rows updated
    
    SQL> select * from dept;
    DEPTNAME   COLOR  TEAMID
    ---------- ------ ---------------
    SALES      ORANGE SALOR1
    ACCOUNTING BLUE   ACCBL2
    BILLING    YELLOW BILYE3
    
    SQL> rollback;
    Rollback complete
    
    SQL> drop table dept purge;
    Table dropped
    
    SQL>
    

    ----

    Ramin Hashimzade

  • How to fill the empty space when the component is not visible or hidden?

    I have several components in BorderPane which can be visible or not using not check box. When I put the component not to be visible, I get an empty space I want to complete resizing the next component. What options are available to configure the components to fill the empty space when the component is defined on .setVisible(false); ?

    So that a node only takes place when it is invisible,

    before you change the visibility property, call:

    node.managedProperty().bind(node.visibileProperty());
    

    Or you can simply remove the node from the graphic scene:

    parent.getChildren().remove(node);
    
  • Fill two empty columns with the values in a column (all in the same table)

    Can someone point me in the right direction? I want to fill the column prefix and suffix with the AcctNum data.

    "Prefix is the part of the number before the '-' and the suffix is everything after the '-'. '. Write a SQL command to fill the column prefix and suffix.
    *Accounts* 
    
    AcctNum   Prefix   Suffix
    -------   ------   -------
    123-0097
    X089-056
    123-0097
    123-0098
    F3377-D
    X089-057
    X089-058
    3-009712
    It is supposed to look like this:
    *Accounts* 
    
    AcctNum   Prefix   Suffix
    -------   ------   -------
    123-0097    123     0097
    X089-056
    123-0097
    123-0098
    F3377-D
    X089-057
    X089-058
    3-009712
    That's what I came with, but it does not work because it is basically putting multiple values into a single cell:
    update accounts
         set prefix=(select substr(acctnum, 1, instr(acctnum,'-')-1) from accounts),
         suffix=(select substr(acctnum, instr(acctnum, '-')+1) from accounts)
         where acctnum=(select prefix||'-'||suffix from accounts);
    I want this query is incredibly easy and I have forget something. Any help is greatly appreciated.

    Published by: 885913 on September 18, 2011 12:53
    UPDATE accounts a
    SET    ( prefix, suffix ) = (SELECT Substr(acctnum, 1, Instr(acctnum, '-') - 1),
                                        Substr(acctnum, Instr(acctnum, '-') + 1)
                                 FROM   accounts b
                                 WHERE  a.acctnum = b.acctnum);
    
  • Displays the empty columns instead of data

    I grew up a table from data source in the physical layer. I checked the data in the view, and there are data for all columns.
    I need to create a report of this table (only). All the fields, I need to create the report exist in the same table. I didn't need another table to create this report.
    But just for the sake of creating joins, I joined with a fact table in the physical layer and in the same way, at a table of dimension and/or fact in MDB table.
    I created the report and the data is not displayed for columns 4 and 5. It displays empty for these columns.
    Help, please.

    Hello
    try to purge the cache of the administrator and close all cursors to manage the side sessions answers then try to run the report.
    Also check the properties of the columns in the physical layer to see the length defined for the column.

  • How can I create a column with additional dates in number 3.6.1

    I'm a noob for Mac so be gentle with me. I have a spreadsheet and need to have additional dates in the first column of 01.01.16 at the end of the year.  I managed to create a custom date format and changed cells to be this format, but no date appears in the cells.  What did I miss? Thank you

    Here's a way to do it:

    First, make sure that your table has enough lines for all the dates you want.

    Then enter your first date is in, say, A2.  A3 (the cell below) enter the following formula: = A2 + 1

    Select the cell containing the formula, place the cursor on the lower edge, then drag the yellow point to the bottom of the column.

    You can also select the cell containing the formula, command + c to copy, select all the cells in the column and command-v to paste.

    You can, of course, always use the custom date format you like.

    SG

  • How to fill the entire screen with the background color?

    It doesn't seem like it should be difficult, but of course, it seems to be. I put the background color on themy page, but it only fills half the screen in the Simulator. It's a small page.

    OK, so I went to some styles. I updated the style of the body height: 100%; min-size: 100%. That no longer works. Then I added a

    that enveloped the rest of the content on my page and set the style to the same height: 100%; min-size: 100%. Still nothing.

    What gives? Of course, the Simulator seems all ignore them.

    I use the VS plugin and simulate with the simulator of the storm.

    Thank you

    Bill

    in the onload of the body, you can also do this line of code:

    document.body.style.height = screen.height + 'px';
    
  • Replace the empty column with ZERO values

    Hi experts,

    I'm building a report to display the number of orders per channel / day / hour.

    Since a few days one or several channels may not all orders placed against them in which case my report shows empty values in the report.

    Ideally, I would have zero in these columns rather than an empty cell.

    Sample Qry: -.

    Select
    Channel,
    Count (order_num) County
    Of
    SALES_ORDER

    Pls help!


    Thanks in advance.

    Count always returns 0 if no line found or the actual number based on the found rows. You don't even have to NVL them. I think so
    the problem is in your report layout, in my opinion.

    You run query sqlplus, or Toad or sqldevloper and you can see for yourself that the count is 0.

    See you soon.
    VIN.

  • How to get the empty values for common data for a column?

    Hello
    I have a table whose data is like this:
    DEPT_ID     STATUS     USER_ID     ART_ID
    
    7     R     1234     0000001
    7     P     2411     0000002
    7     Q     1231     0000003
    7     S     7676     0000004
    3     R     6776     0000005
    3     S     7869     0000006
    6     Q     787     0000007
    6     W     5656     0000008
    .......more data like this
    How can we get this are data in this format:
    7     R     1234     0000001
         P     2411     0000002
         Q     1231     0000003
         S     7676     0000004
    3     R     6776     0000005
         S     7869     0000006
    6     Q     787     0000007
         W     5656     0000008

    In SQL * Plus, you can use the PAUSE command

    SQL> break on deptno;
    SQL> ed
    Wrote file afiedt.buf
    
      1  select deptno, ename
      2    from emp
      3*  order by deptno
    SQL> /
    
        DEPTNO ENAME
    ---------- ----------
            10 CLARK
               MILLER
               KING
            20 FORD
               smith
               ADAMS
               SCOTT
               JONES
            30 SM0
               TURNER
               BLAKE
               MARTIN
               ALLEN
               WARD
               PAV
               BAR
    
    16 rows selected.
    

    In SQL, you must use an analytic function

    SQL> ed
    Wrote file afiedt.buf
    
      1  select (case when deptno = prior_deptno
      2               then null
      3               else deptno
      4            end) deptno,
      5         ename
      6    from (select deptno,
      7                 lag(deptno) over (order by deptno, ename) prior_deptno,
      8                 ename
      9            from emp
     10*          order by deptno, ename)
    SQL> /
    
        DEPTNO ENAME
    ---------- ----------
            10 CLARK
               KING
               MILLER
            20 ADAMS
               FORD
               JONES
               SCOTT
               smith
            30 ALLEN
               BLAKE
               MARTIN
               SM0
               TURNER
               WARD
               BAR
               PAV
    
    16 rows selected.
    

    Justin

  • How to delete the 2 files with expiration date 25/07/2014?

    Found 2 records in history settings - display the files. type-txt doc. cannot delete I suppose that's the expiration date. How can I change the date? or y at - it another way to remove? Also have a damaged object - visualization of objects that I cannot remove.

    Click on Security tab, uncheck keep favorite Web sites. then delete the history.

    Still have a problem with the damaged object - type active x control id but nothing else has.

  • How to select the group header with detailed data in a SQL

    Dear Sir

    I wish I had a little help from you. My goal is to create a view where the data should be in the appropriate format. In this format, I want to have for each header of a group.

    I have 3 tables that they ar connected to the other (representing hierarchical data where financial plan breaks in different groups).

    CRM_PLAN
    CRM_PLAN_ID
    DATE
    AMOUNT

    CRM_PLAN_PE
    CRM_PLAN_PE_ID
    TITLE
    AMOUNT
    CRM_PLAN_ID (REF CRM_PLAN key. CRM_PLAN_ID)

    CRM_PLAN_MONTH
    CRM_PLAN_MONTH_ID
    YEAR
    MONTH
    AMOUNT
    CRM_PLAN_PE_ID (foreign key to CRM_PLAN_PE. CRM_PLAN_PE_ID)

    Data looks like:

    CRM_PLAN
    CRM_PLAN_ID | DATE | AMOUNT
    1. 01.01.2012. 500
    2. 01.02.2012 | 200

    CRM_PLAN_PE
    CRM_PLAN_PE_ID | TITLE | AMOUNT | CRM_PLAN_ID
    1. Organization 1. 100. 1
    2. Organization 2. 400. 1
    5: 3 organization | 200 | 2


    CRM_PLAN_MONTH
    CRM_PLAN_MONTH_ID | YEAR | MONTH | AMOUNT | CRM_PLAN_PE_ID
    1. 2012 | 1. 60. 1
    2. 2012 | 2. 40. 1
    5: 2012 | 1. 350. 2
    4. 2012 | 2. 50. 2
    3: 2012 | 1. 200 | 3


    I would like to than the view that returns data as:

    MONTH | AMOUNT
    Organization 1. null
    1. 60
    2. 40
    Organization 2. null
    1. 350
    2. 50
    3 organization | null
    1. 200

    The main question is hot to write a sql as source for display to insert before each group a line with the value of the title of the table CRM_PLAN_PE column. Is it still possible? Perhaps you could suggest another method.

    Notice will be used in the form of oracle where will be possible to change the data - I will make the necessary arrangements by trigger INSTEAD of.

    Kind regards
    Igor

    Published by: user5528050 on 29.11.2012 02:23

    Published by: user5528050 on 29.11.2012 02:24

    Published by: user5528050 on 29.11.2012 02:25

    Hi, Igor,.

    In this case, I think ROLLUP is a little simpeler GROUPING SETS, but you could do it anyway:

    SELECT       CASE
               WHEN  GROUPING (tab2.id) = 0
               THEN  TO_CHAR (tab2.id)
               ELSE  tab1.title
           END               AS col_1
    ,       SUM (tab2.amount)     AS col_2
    FROM       tab1
    JOIN       tab2     ON  tab1.id     = tab2.tab1_id
    GROUP BY  tab1.title
    ,            ROLLUP (tab2.id)
    ORDER BY  tab1.title
    ,         GROUPING (tab2.id)     DESC
    ,            tab2.id
    ;
    

    If tab2.id cannot be NULL, you can use

    NVL ( TO_CHAR (tab2.id)
        , tab1.title
        )
    

    instead of the CASE expression and simplify the ORDER BY clause to

    ORDER BY  tab1.title
    ,            tab2.id            NULLS FIRST          
    
  • Fill the InDesign document with external data?

    Hi all, I hope that I ask this question in the correct forum. I'm assuming that it is a problem of script, but if not, I apologize. Anyway - wonder if this is possible and, if so, if someone could point me in the general direction of more information:

    My company occasionally asked to produce directories of employee containing information (photos, contact information, education information, etc.) on different segments of the population closes - for example, a directory can include all women of color, we can include everyone in the Los Angeles Office, etc.. I would like to find a way to 'model' it in InDesign so that the relevant info can circulate in the external data source document - for example, database SQL of the HR or perhaps a spreadsheet generated from this database. I know that we are currently able to do something similar by using Word, but the final product looks like crap.

    I don't know what that would be even called in InDesign, so any information will be greatly appreciated. I use the CS5 version. Thank you!

    I could do this by using the data merge feature. It is similar to the functionality of fusion and mail merge in word. There is a great video of how it works here: http://www.theindesigner.com/blog/episode-43-data-merge-video

    There are more complex ways using XML or the third party plug-ins, but I would try this method first.

    Colly

  • How to display the database column value in a component of choice selected?

    Hello everyone;

    I use Jdeveloper 11.1.1.4 and right now I have the .jspx UI page that includes < af:selectonechoice / > components and according to the requirment I have to fill one of the column in the table in this drop-down list.

    can someone tell me how to fill the database column value in this drop-down list. I know I need to create the VO for the same thing, but I'm new to this technology. Then please suggest.

    Thanks in advance.,

    This will help u

    https://blogs.Oracle.com/prajkumar/entry/create_lov_in_adf_application

    How to create LOV in ADF 11 g | Techartifact

    Oracle Fusion Middleware Technologies: 11G: how to create a list of Values (LOV)?

    http://www.baigzeeshan.com/2010/03/creating-lov-in-ADF-application.html

    http://husaindalal.blogspot.de/2010/05/How-to-default-lov-with-its-first-value.html

  • How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    How to take a column of duplicate names and fill a different column with the same names, excluding duplicates?

    I find easier to use this copy separate Automator Service (download Dropbox).

    To install in your numbers > Services, double-click menu just the package downloaded .workflow and if necessary give permissions in system preferences > security & privacy.

    To use, just:

    1. Select the cells in the column with duplicate names.
    2. Choose separate copy in numbers > Services menu.
    3. Click once in the upper cell where you want the deduplicated values appear.
    4. Command-v to paste.

    SG

  • How to fill the canvas with lines

    < mx:Canvas id = "b1" x = "10" y = "10" height = "40" width = "300" borderStyle = "solid" borderColor = "black" / >

    When I want to draw lines with difference of 15 pixels to fill the entire canvas I wrote the following

    for (var i: int = b1.x + 15; i < b1.x + b1.width; i = i + 15)
    {
    var line1:UIComponent = new UIComponent();
    var lineThickness1:Number = 1;
    var lineColor1:Number = 0 x 000000;
    var lineAlpha1:Number = 1;
    LINE1. Graphics.LineStyle (lineThickness1, lineColor1, lineAlpha1);
    LINE1. Graphics.MoveTo (i, B1.y);
    LINE1. Graphics.LineTo (i, B1.y + B1. Height);
    this.addChild (line1);
    }

    It works very well

    LLY,

    < mx:Canvas id = "b4" x = "600" y = "200" height = "60" width = "300" borderStyle = "solid" borderColor = rotation "black" = "40" / >

    I have the canvas above with the "b4" id only difference is that this canvas rotation

    How to fill the canvas with lines that I just did above?

    Hope this code will help you,

    for(var i: int = 15; i < b4.width; i = i + 15) {
         var line1: UIComponent = new UIComponent();
         var lineThickness1: Number = 1;
         var lineColor1: Number = 0x000000;
         var lineAlpha1: Number = 1;
         line1.graphics.lineStyle(lineThickness1, lineColor1, lineAlpha1);
         line1.graphics.moveTo(i, 0);
         line1.graphics.lineTo(i, b4.height - 1);
         //Add line in canvas instead of main container
         b4.addChild(line1);
    }
    
    
    

Maybe you are looking for