Ignore empty rows at end

I have a csv file, which has empty lines at the end.
My controlfile has a default sequence, due to which it is uploading all the empty lines at the end.
How can i tell sql*loader to ignore these lines ?
load data append into table Test_Data_staging
fields terminated by "," optionally enclosed by '"' trailing nullcols          
SERIAL_NUMBER SEQUENCE(COUNT,1),
TEST_DATA_VERSION,
ENVIRONMENT,
TEST_DATA_OWNER
)

Hi,
you can add a when clause (WHEN firstcolumn != BLANKS), here is an example:
LOAD DATA
INFILE 'C:\Temp\Book1.csv'
BADFILE 'C:\Temp\Book1.bad'
DISCARDFILE 'C:\Temp\Book1.dsc'
TRUNCATE
INTO TABLE "XTEST"
WHEN (col1 != BLANKS)
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' AND '"'
TRAILING NULLCOLS
(COL1,
COL2,
COL3)or if you want:
LOAD DATA APPEND INTO TABLE TEST_DATA_STAGING
WHEN (TEST_DATA_VERSION != BLANKS)
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
SERIAL_NUMBER SEQUENCE(COUNT,1),
TEST_DATA_VERSION,
ENVIRONMENT,
TEST_DATA_OWNER
{code}
Edited by: user11268895 on Aug 30, 2010 1:56 PM
Edited by: user11268895 on Aug 30, 2010 1:56 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Ignore empty rows

    I have the following table structure
    AccountTable
    ...accountID
    ...RegionID
    ...CategoryID
    ...subtypeID
    CategoryTable
    ...CategoryID
    ...accountID
    RegionTable
    ...RegionID
    ...accountID
    SubtypeTable
    ...SubtypeID
    ...accountID
    I want to form a query which will select all accounts belonging to a category,region & subtype(all AND).suppose if any of this table doesnt have data then the query should ignore that table and get data for the other two conditions. is there any way to do that in PL/SQL??(no procedures/functions)

    Hi,
    My problem is a bit different. in the tables i've included the wrong attribute.
    CategoryTable
    categoryID
    criteriaID
    RegionTable
    regionID
    criteriaID
    I want to get all the accounts belonging to particular category/region with a particular criteria ID(All AND).so i have to have a query like
    select accountID from accountstable acc where
    acc.regionID in (select regionID from regiontable where criteriaID = 34)
    and
    acc.categoryID in (select categoryID from categorytable where criteriaID = 34)
    but the problem is if any one of category/region is not having record it wont get me rows for the other condition
    I cameup with a solution like this
    select accountID from accountstable acc where
    acc.regionID in (select regionID from regiontable where criteriaID = 34)
    or
    (select count(regionID) from regiontable where criteriaID = 34) = 0)
    and
    acc.categoryID in
    select categoryID from categorytable where criteriaID = 34)
    or
    (select count(categoryID ) from categorytable where criteriaID = 34) = 0)
    This works fine as it negates the condition when no row is found. the pblm is it is taking more time
    any suggestion??

  • How can I create an empty row on a #TempTable based on an input parameter

    So if my Line of Business is 'MC' or 'MG', I have to go over to Oracle and get its data accordingly. Then, when I create my final report result set, I think I'll want to UNION in that result set if my Parameter is 'MC' or 'MG'. I don't think I can UNION
    based on the value of the Parameter. So my thought process was to create an empty row on my #TempTable so when I UNION and my parameter is NOT 'MC' or 'MG' then it will have nothing to UNION in. My struggle is how do I create an empty row in my #TempTable
    if my parameter is NOT 'MC' or 'MG'
    If I am wwwaaayyy off here, please tell me so.
    This is my #TempTable Creation SQL...
    IF EXISTS
    (SELECT 1
    FROM [#TempTable_LineOfBusiness_Parameter]
    WHERE [#TempTable_LineOfBusiness_Parameter].[RESULT] IN ('MC','MG'))
    BEGIN
    SELECT *
    INTO [#TempTable_Market_Prominence_Member_Data]
    FROM OPENQUERY
    (RPDMHF,
    'SELECT HCFA_NAME_ORG.NAME_ID,
    HCFA_NAME_ORG.MEMBER_ID,
    HCFA_NAME_ORG.HIC_NUMBER,
    MEMBER.NAME_FIRST,
    MEMBER.NAME_LAST,
    HCFA_DATE.START_DATE,
    HCFA_DATE.END_DATE,
    HCFA_NAME_ORG.COUNTY_CODE,
    HCFA_NAME_ORG.PART_A_PAYMENT,
    HCFA_NAME_ORG.PART_B_PAYMENT,
    HCFA_NAME_ORG.STATUS,
    HCFA_NAME_ORG.ORG_ID,
    HCFA_NAME_ORG.PLAN,
    HCFA_NAME_ORG.ENROLL_DATE,
    HCFA_NAME_ORG.PBP_ID,
    HCFA_DATE.VALUE
    FROM SC_BASE.HCFA_DATE
    LEFT JOIN SC_BASE.HCFA_NAME_ORG
    ON HCFA_NAME_ORG.NAME_ID = HCFA_DATE.NAME_ID
    LEFT JOIN AMIOWN.MEMBER
    ON TRIM(MEMBER.MEMBER_NBR) = TRIM(HCFA_NAME_ORG.MEMBER_ID)
    WHERE HCFA_DATE.INDICATOR = ''plan''
    AND HCFA_DATE.START_DATE >= ''2015-01-01''
    END
    If I add an ELSE, it always comes back and tells me the #TempTable_Market_Prominence_Member_Data already exists. As if it's creating it regardless of the Top IF.
    Thanks for your review and am hopeful for a reply.

    Hi ITBobbyP,
    The error came back from your ELSE Statement most probably caused by the reason mentioned in Hoffmann's post.
    Regarding your requirement, I would suggest you CREATE the [#TempTable_Market_Prominence_Member_Data] explicitly.
    CREATE TABLE [#TempTable_Market_Prominence_Member_Data]
    NAME_ID INT,
    MEMBER_ID INT,
    HIC_NUMBER VARCHAR(99),
    NAME_FIRST VARCHAR(99),
    NAME_LAST VARCHAR(99),
    START_DATE DATE,
    END_DATE DATE,
    COUNTY_CODE VARCHAR(99),
    PART_A_PAYMENT MONEY,
    PART_B_PAYMENT MONEY,
    STATUS VARCHAR(99),
    ORG_ID INT,
    PALN VARCHAR(99),
    ENROLL_DATE VARCHAR(99),
    PBP_ID INT,
    VALUE INT
    IF EXISTS
    (SELECT 1
    FROM [#TempTable_LineOfBusiness_Parameter]
    WHERE [#TempTable_LineOfBusiness_Parameter].[RESULT] IN ('MC','MG'))
    BEGIN
    INSERT INTO [#TempTable_Market_Prominence_Member_Data]
    SELECT *
    FROM OPENQUERY
    (RPDMHF,
    'SELECT HCFA_NAME_ORG.NAME_ID,
    HCFA_NAME_ORG.MEMBER_ID,
    HCFA_NAME_ORG.HIC_NUMBER,
    MEMBER.NAME_FIRST,
    MEMBER.NAME_LAST,
    HCFA_DATE.START_DATE,
    HCFA_DATE.END_DATE,
    HCFA_NAME_ORG.COUNTY_CODE,
    HCFA_NAME_ORG.PART_A_PAYMENT,
    HCFA_NAME_ORG.PART_B_PAYMENT,
    HCFA_NAME_ORG.STATUS,
    HCFA_NAME_ORG.ORG_ID,
    HCFA_NAME_ORG.PLAN,
    HCFA_NAME_ORG.ENROLL_DATE,
    HCFA_NAME_ORG.PBP_ID,
    HCFA_DATE.VALUE
    FROM SC_BASE.HCFA_DATE
    LEFT JOIN SC_BASE.HCFA_NAME_ORG
    ON HCFA_NAME_ORG.NAME_ID = HCFA_DATE.NAME_ID
    LEFT JOIN AMIOWN.MEMBER
    ON TRIM(MEMBER.MEMBER_NBR) = TRIM(HCFA_NAME_ORG.MEMBER_ID)
    WHERE HCFA_DATE.INDICATOR = ''plan''
    AND HCFA_DATE.START_DATE >= ''2015-01-01''
    END
    Explicitly creating the temp table will offer below benefit in this case.
    The ELSE statement is no longer needed, if the no rows get inserted into that table, it has nothing to union an empty table.
    With the column datatype defined, you can avoid such conversion error
    SELECT NULL AS COL1,NULL AS COL2 INTO #T
    SELECT COL1,COL2 FROM #T
    UNION
    SELECT 1,'ABC'--Conversion failed when converting the varchar value 'ABC' to data type int.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Appending empty rows in internal table

    Hi,
      i am using table control, where there is a condition, some row may left empty. end if i press enter button the empty row is filled by the next available record. My need is to pick the records in the table control to the internal table including the empty rows as it is.

    Hi Karthikeyan,
    By default with user pressinng enter, empty rows will get deleted.
    How are you populating your table control? Is it from standard transaction or your internal table?
    If it is from your internal table, you can add anothe flag field for empty row.
    Whenever row is empty in your internal table, mark flag field as 'X', so in the table control you these entries will not get vanished with pressing of enter.
    This is one idea and you can build on this. You can make this flag column as non editable so that no one can change these.
    hope this helps,
    ags.

  • Preventing empty rows in address formats

    Hallo everyone!
    I'd like to know if there is a method to prevent SBO2005A from printing empty rows in the address fields when for instance there is missing county in BP addresses like this:
    I have defined an address format that goes
    Block
    County
    Street
    ZipCode | Freetext(" ") | City
    We use Block as "Name2" and County as "Name3" in master data just in case the customer wants to use additional names for his BPs.
    If I use the "Block" - field and I leave the "County" - field blank it prints an empty row between "Block" and "Street". This is not the behaviour I would like to see. In case "county" is missing I would rather see something like this in a printout:
    Block
    Street
    ZipCode | Freetext(" ") | City
    So, is there a method to force this? or any workaround?

    Hello Patryk,
    PLD does not offer the functionality to control the blank lines in an address field.  I would suggest you use a formatted search in your address field on the marketing document and have it formatted in the document itself before you print.
    Please see sample code for your requirment for the Ship to address.  If you want this to applied to the Bill to address field then you have to slight alter the query by cha
    For Shipto address formatting
    SELECT CASE WHEN T0.Block IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.Block + CHAR(13) + CHAR(10) ELSE '' END +
    CASE WHEN T0.County IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.County + CHAR(13) + CHAR(10) ELSE '' END +
    ISNULL(T0.Street, '') + CHAR(13) + CHAR(10) + ISNULL(T0.ZipCode, '') + '  ' + ISNULL(T0.City, '')
    FROM  [dbo].[CRD1] T0 WHERE T0.AdresType = 'S' AND T0.Address = $[$40.0.0] AND T0.CardCode = $[$4.0.0]
    For Billto address formatting
    SELECT CASE WHEN T0.Block IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.Block + CHAR(13) + CHAR(10) ELSE '' END +
    CASE WHEN T0.County IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.County + CHAR(13) + CHAR(10) ELSE '' END +
    ISNULL(T0.Street, '') + CHAR(13) + CHAR(10) + ISNULL(T0.ZipCode, '') + '  ' + ISNULL(T0.City, '')
    FROM  [dbo].[CRD1] T0 WHERE T0.AdresType = 'B' AND T0.Address = $[$226.0.0] AND T0.CardCode = $[$4.0.0]
    Suda

  • Delete empty rows while having empty xml tag

    I've seen something like same but it doesn't work for me. I have a table which is created using xml rules, some time it contains empty xml tag also converted into row but I don't want these empty rows. After table creation empty rows need to be deleted.
    I've got this script from this forum which delete empty rows
    for(var i=myDocument.textFrames.length-1; i>=0; i--){
      for(var j=myDocument.textFrames[i].tables.length-1; j>=0; j--){
       for(var k=myDocument.textFrames[i].tables[j].rows.length-1; k>=0; k--){
        myContents = 0;
        for(var l=myDocument.textFrames[i].tables[j].rows[k].cells.length-1; l>=0; l--){
         if (myDocument.textFrames[i].tables[j].rows[k].cells[l].contents != "") myContents++;
         if (myContents == 0) myDocument.textFrames[i].tables[j].rows[k].remove();
    but incase of any cell contains empty xml element it goes blank. Could any one help on this.
    Thanks
    Mac

    Gyan,
    Thanks for your help. I have modified the code as below:
    public void removeblankline()
    OAViewObject rvo = (OAViewObject)findViewObject("NCRPaymentExtLineVO1");
    Row row[] = rvo.getAllRowsInRange();
    System.out.println("Remove all blank rows");
    System.out.println("Total Rows"+rvo.getRowCount());
    int jcount = rvo.getRowCount();
    for (int j=0;j< jcount;j++)
    NCRPaymentExtLineVORowImpl rowj = (NCRPaymentExtLineVORowImpl)row[j];
    System.out.println("Check Line Number: "+j);
    System.out.println("Line Type Lookup Code: "+rowj.getLineTypeLookupCode());
    if((rowj.getLineTypeLookupCode()==null)||("".equals(rowj.getLineTypeLookupCode().trim())))
    System.out.println("Removed Line Number: "+j);
    rowj.remove();
    System.out.println("Processed with Line Number: "+j);
    } // end removeblankline
    This is the change I have done:
    int jcount = rvo.getRowCount();

  • Ignore blank rows inbetween in Xcelsius

    Hi,
    We are using Xcelsius 2008, we need to ignore blank rows which are there inbetween few rows.
    so we have few rows data and few blank rows rhen data and blank rows.
    Ignore blank rows will only ignore the rows if its in end but it doesn't if we have inbetween.
    So is there any workaround for that or any alternate component i can use. I am sing list view in current design.
    Thanks,
    Nimesh.

    Re: Ignore blank rows inbetween in Xcelsius
    Hi Daniel,
    Thanks for your solution.
    I was facing the same issue and was able to solve it using that Flag concept.
    Thanks,
    Seema

  • I need a method for ignoring empty lines

    Hi to all,
    i need a method for ignoring empty lines when my program reades a file like that
    start of file
    print "xoxox"
    //ignore this line
    println"xaxaxa"
    //ignore this line
    end of file
    cheers

    Are you having trouble detecting these empty lines? Or are you having trouble not processing them once you've detected them?
    For the first case, you neeed to define "empty." I assumed it meant "containing no characters," and that's what the first solution shows. Your example looks like "empty" means "starts with comment characters."
    For the second case, you ignore them by just not doing anything: read a line
    if (it is not empty) { // by whatever criteria you define for "empty"
       do something with it
    }

  • Create empty row

    Hi All,
    I face some problem to create empty row. I need a empty row to show user that is end of operation.
    The output that I need as below.
    OprA     OprB     Data
    A100     (null)     Definition
    (null)     B100     Definition
    (null)     (null)     (null)
    A200     B200     Definition
    A200     (null)     Definition
    (null)     B200     Definition
    (null)     B200     Definition
    all of the null column from row 1, 2, 4, 5, 6, 7 is direct select from table. The row 3 is what I want to create. example A100 is same group with B100. After show last B100, is end of operation '100'. and need a empty or null row. Then continue with operation '200'.
    Thanks for who help me on this.

    Hi Skymonster,
    Not sure how you would be doing your processing.
    However assuming if you are doing it one after the other, meanig you first process 100 display it (here is where you want to append 200 now)
    here is one way of doing it.
    with data as (
    select 'A100' a,null b ,'DEFINiTION' c from dual union all
    select null,'B100','DEFINiTION' from dual),
    dat2 as (
    select null,'B200','DEFINiTION' from dual union all
    select 'A200',null,'DEFINiTION' from dual union all
    select null,'B200','DEFINiTION' from dual)
    select * from data
    group by rollup(a,b,c)
    having (grouping(a)=1 and grouping(b)=1 and grouping(c)=1) or
    (grouping(a)=0 and grouping(b)=0 and grouping(c)=0)
    union all
    select * from dat2However i am of the strong opinion that formatting should be handled by front end application and not in such a manner especially in this case.
    Peter's example is much better than mine where you directly uinon NULL
    Howver if you can give a clue how we can identify end of a record that will be helpfull.
    Regards,
    Bhushan

  • Empty Row ?????

    Hi
    I have a page with a grid with Record name My_Record. Grid delivered add row is not used instead a custom add Button is present below the grid to add a row .
    On Field Change of Custom Add Button :
    &Rowset0 = GetLevel0();
    &Rowset1 = &Rowset0(1).GetRowset(Scroll.My_Record);
    &Rows = &Rowset1.ActiveRowCount;
    If &Rows = 1 And
    &Rowset1(1).IsNew Then
    &NewRowNumber = 1; /* component variable to track current row */
    Else
    &Rowset1.InsertRow(&Rows);
    &NewRowNumber = &Rows + 1; /* component variable to track current row */
    End-If;
    &RETURN_MODAL = DoModal(Page.MY_SEC_PAGE, "", - 1, - 1, 1, Record.My_Record, &NewRowNumber);
    but when i save first time , it always going to save an additional empty row in the record.
    How an empty row is bieng inserted ?
    On page there is no field on Level0 , if this is the issue ?

    Problem Solved....
    There was another Page in the Component which was no longer required. It had fields of this Record at Level 0 so when Save was called, it saved an Empty Row.
    Edited by: Mohsin on Aug 15, 2012 4:52 PM

  • Add empty return at end of story

    Hi experts
    How can make a script for add some empty return at end of sotry, not matter the end is a table without any return?
    Thanks
    Regard
    John

    Thank you Chinna
    thank you so much
    this script as below function for remove empty column, but in active doc
    now I only need it work in selection[0]
    could you please help me change it only work in app.selection[0]?
    myDoc = app.activeDocument;
    findTable();
    function findTable(){
    for ( s = myDoc.stories.length-1; s >= 0; s-- ){
      for ( t = myDoc.stories[s].tables.length-1; t >= 0; t-- ){
       myTable = myDoc.stories[s].tables[t];
       removeCurrentColumn();
    function removeCurrentColumn(){
    for ( i = myTable.columns.length-1; i >= 0; i-- ){
       if (currentColumnIsEmpty(i) == true){
       myTable.columns[i].remove();
    function currentColumnIsEmpty(col){
        theColumnIsEmpty = true;
    for ( k = myTable.rows.length-1; k >= 0; k-- ){
      if (myTable.cells.item(col + ":" + k).texts[0].contents != ""){
       theColumnIsEmpty = false;
      return theColumnIsEmpty;
    function findTableDel(){
    if (myDoc.stories.everyItem().tables.length > 0) {
      myAllTables = myDoc.stories.everyItem().tables.everyItem();
      for ( s = myAllTables.length-1; s >= 0; s-- ){
       myTable = myAllTables.item[s];
       removeCurrentColumn(myAllTables[s]);
    Thank you
    Regard
    John

  • Identify empty rows in Excell  using POI

    Hi,
    Could U please tell me how to identify empty rows in Excell sheet using Apachi POI (poi-3.6-20091214.jar).
    Thanks.
    DNA

    Hi,
    I used the following algorithm to identify empty rows (contains value deleted cells). within the main program it is used to by pass the empty rows in an excel sheet.
    If some one has a better solution please do share it with us.
    Program to identify empty rows
    {color:#3366ff}BEGIN
    row -> Instance of the row iterator. Goes through each row.
    cell -> Instance of the cell iterator. Goes through each cell.
    isCellEmpty -> boolean value to assign status.
    rowsToOmit -> An ArrayList which stores the omitted rows.
    WHILE(Has another row){
    get Cell Iterator of row
    WHILE(Cell Iterator Has another cell){
    IF(cell value == "")
    then isCellEmpty is TRUE
    ELSE{
    then isCellEmpty is FALSE
    BREAK
    IF(isCellEmpty value is true)
    Add row to rowsToOmit
    END{color}
    Edited by: nalagiri on Sep 19, 2010 11:37 PM

  • Strange empty rows

    Hi all
    I have a geography dimension which is a simple table coming from the DWH (Oracle DB).
    Geography(ALL/country/store)
    when I display only all the stores in a report ,I have an empty row at the end of the table.
    ----------------|
    GEOG
    ----------------|
    store 1
    store 2
    store n
    empty row
    It's the case for some other attributes.
    Any knows why.?
    Regards

    I wasn't aware of this option,THANKS STIJN
    I tried to use it and in the where clause he doesn't accept more than 2 clauses.
    And I need to make a filter on different columns.
    Regards
    Adil

  • Check empty rows

    Hi,
    How to check for empty rows in a table in a procedure, I was expecting null to set in the assigned variable instead of it I'm getting exception and it comes out from the loop altogether.
    Any help would be appreciated.
    Thanks.

    No rows or columns with null values?
    If no rows, use
    exception when no_data_found then
    <your_code>;
    end;

  • Supress empty rows !

    Hi,
    How to supress empty rows?
    i want to supress the rows in a report that does not have a value. i wish to display only those recors which has some value.
    I have tried using Supress = Y under expansion, nothing happened.
    any ideas ?
    Regards

    Hi ,
    If you are creating an EVDRE report and if you want to ignore the rows with zero values then you can use 'Y'.
    Please check if your report says  EVDRE=OK on the left top corner of excel to see if syntax is correct
    you can use this expansion rows under SUPPRESS as mentioned by you.
    SUPPRESS=Y
    Please let us know . thanks.
    Sanjeev

Maybe you are looking for

  • Errors In Automatic payment program

    Hi ,    I am undergoing training in SAP FI CO. I am presently dealing with the               automatic payment program in Accounts Payable. I had errors when I was running the proposal item in the transaction code F110 like this:    1.No payment poss

  • Making a .app in C++

    I'm a fairly experienced C++ programmer, and have been using gcc in the terminal to compile programs in OSX. I'm trying to build a program to offer online as a download, but the problem is when you transfer the program to another program the permissi

  • Error with bex query in web

    Good morning together, i have trouble again with a BEx Query in our BW landscape. I have created a query with a lot of key figures. When i call it in BEx (Excel) i get data; everything is ok. But when i say, execute this query in web, or try to call

  • Where do I configure hotkeys in Coldfusion Builder 2.0?

    I want to configure hot keys. I don't see that as an option anywhere. Is it still possible? Thanks,

  • Why does Firefox keep telling me that it is using too much memory, (eg: 235MB) and I should restart Firefox?

    Lately Firefox has been popping up a warning while I am on the internet saying, that "Firefox" is using too much memory. It suggests shutting down Firefox and restarting Firefox. It also told me how much memory that is in use at that time. It is usua