Is there a way to know how many rows were rejected using external tables?

Hi,
I'm developing a package that needs to load different kinds of text files into the DB.
I was wondering whether there's a way of knowing in SQL or PL/SQL how many rows were rejected if my external table is defined with "reject limit unlimited".
I'm using the external tables in "insert into ... (select ... from external_table where...)"
sql%rowcount returns the number of inserted rows
I was hoping for something similar/easy to get the number of rejected rows as well.
I know I can try to analyze the bad file for the number of records if there's no other way...
Thanks in advance.

Pyrocks wrote:
I was afraid of this answer...
this is a certain "no there's no other way" or should i wait for other responses (no disrespect - just want to make sure :) )Well the difference would be that this external table will have no complex logic. You would simple read in all the lines from the bad file. The chances that this is broken are therefore very slim compared with your original external table.
And tehre are many other ways possible. For example you can first copy the file into a real internal (temp) table without using any processing logic but with using an external table. Then do the processing / logic checking of the data and move the data from this temp table into your final data structure. Since you move the data two times the whole process will be slower then the original version.

Similar Messages

  • Is there a way to know how many hours of work did a project demanded ?

    Is there a way to know how many hours of work did a project demanded (even if it was on multiple days, sessions or cross-working other projects)?
    I am using Adobe Premiere Pro CS6 on windows 7.
    Thaks,
    Mihai

    There is no feature for that in Premiere Pro.  I suggest that you keep a project log either in a spreadsheet, database, Notepad or Wordpad file, or a hand written one.
    You can file a feature request here:
    Adobe - Feature Request/Bug Report Form

  • Is there a way to know how many minutes left from ...

    Is there a way to know how many minutes left from your subscription from the Skype phone app??
    Thanks!

    Hi, Konfuzed,
    Thanks for your inquiry. The Skype Mobile apps look a bit different.  In order for the Skype Community to help you, some more information would be helpful:
    - Hardware you use (phone/tablet brand and model)
    - Its operating system (version and updates installed)
    - Skype version used
    Thanks in advance.
    - Skype Community Moderation Team
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • Is there a way to know how many tabs are open in the current window?

    I have a habit of keeping lots and lots of tabs open in my Firefox window. Sometimes, I'd like to know how many are open so that I can go through and close some of them if the number is excessive...(or at least excessive by my standards).
    How do I get a quick count of the number of open tabs? Surely I don't have to count them myself, do I?

    Hmm I have an solution for this..
    You can use Tab Counter add-on for this. This add-on shows the number of tab in presently opened window on upper right corner beside minimize.
    you get this from following link:
    [https://addons.mozilla.org/en-us/firefox/addon/tab-counter/]

  • Is there any way to know how many copies of the same game I bought with GCU?

    I've bought Dying Light for ps4 probably twice or three times now.. Do return and rebuys count towards your limit of 3 copies of the same game bought with GCU? Or trade up offers? Or on a minimum of $5 deposit? Or does it have to be fully paid off to count?
    After purchasing the game today and having the employee adjust the price of the game for me since this physical weekly ad showed that Dying Light for GCU members is $31.99, I see on my receipt that there is no unlocked game discount. It just says sale price and price match discount. Now, the first employee tried to adjust it for me and applied my GCU which showed $39.99. When she adjusted it to $31.99, it went down to $25 so I guess GCU was applied even after adjusting it. She then called a manager and adjusted it to $31.99 and I got the game for $33+tax.
    So I'm guessing this purchase didn't count towards my limit since I didn't pay when GCU was applied and when it was adjusted, I don't see GCU game discount on receipt. Someone please confirm for me that this didn't count towards the limit. Thanks
    Solved!
    Go to Solution.

    Hi SomethingNanika,
    First, thanks for being a Gamers Club Unlocked (GCU) member! It certainly sounds like you’re taking advantage of your benefits and I’m happy that you’re so consciously aware of the limitations of said benefits. I’m also happy to provide some details around the purchase limits and what does/doesn’t count towards those limits.
    When you purchase a game and pay for it fully, that counts as one towards your limit. If you return that game, that quantity of one is then removed from your limit. However, if you do a return and a rebuy, it basically counts as a wash, as you’re subtracting one and then adding it right back. Furthermore, simply placing a pre-order deposit doesn’t count towards your limit until the game is paid in full and the pre-order is fulfilled.
    Lastly, if your GCU benefits aren’t applied to a purchase, then you are correct in saying that would not count towards your limit of three titles. Also, here’s a refresher:
    “The limits for using your Unlocked membership will be three (3) copies of a new (i.e not pre-owned) video game software title per platform, per year. Collector's and Limited Editions count towards this title limit. Game of the Year editions, usually released much later and including additional content, do not count towards this limit. Game of the Year versions count as a separate title and have their own limit of three copies per platform, per year.”
     Let us know if you have any other questions!
    Brian|Senior Social Media Specialist | Best Buy® Corporate
     Private Message

  • Is there a way to know how much data is being used and broken down

    how to check data useage when you want to contest it ?

    Probably the best way to find out is by contacting your cell carrier...unless that's who you are contesting.

  • Is there an easy way to see how many rows in a table? (selected or unselected)

    Hi all,
    Forgive me if this is a REALLY dumb question but I would love to know if there there is an easy way to to see how many rows there are in a table in InDesign?
    (And I bet I am really going to kick myself when I hear the answer and how simple it probably is..lol !)
    I am working on a huge catalog and am dealing with LOTS of tables...very long tables too at times. I am also doing a lot of copying and pasting back and forth between InDesign and Excel and it would REALLY help if I knew how many rows there are in a table without having to manually count them (TIRESOME!!).
    Also, is there a way to see how many rows I have selected at any one time? It would be SO WONDERFUL if the info box could also provide this information.
    Thank you SO MUCH in advance for your help:))
    Christine
    **UPDATE**
    Oh boy I AM going to kick myself! Why only NOW that I wrote this question did I suddenly notice that the Table palette shows the number of rows and columns? lol.
    Okay, then is there a way to see how many rows I have selected at any given time?

    @Christine – try the following ExtendScript (JavaScript):
    if(app.selection.length === 0
        || !app.selection[0].constructor.name === "Cell"
        || !app.selection[0].constructor.name === "Table"){
        exit(0);
    var sel = app.selection[0];
    if(sel.constructor.name === "Cell"){
        var tableRowLength = sel.parent.rows.everyItem().getElements().length;
    if(sel.constructor.name === "Table"){
        alert("All "+sel.rows.everyItem().getElements().length+" rows selected in current table." );
        exit(0);
    var numberOfRowsSelected = sel.rows.length;
    var indexOfSelectedRows = sel.rows.everyItem().index;
    var startRowSel = indexOfSelectedRows[0]+1;
    var endRowSel = indexOfSelectedRows.length+indexOfSelectedRows[0];
    alert(numberOfRowsSelected +" row(s) selected.\r"+startRowSel+" to "+endRowSel+" out of "+tableRowLength+" of current table.");
    You need not select whole rows, just one or a couple of cells.
    Then run the script.
    An alert message is telling you how many rows belong to the cell range you have selected and:
    which rows of the table are selected…
    A typical message would be:
    6 row(s) selected.
    3 to 8 out of 20 of current table.
    The script does some basic checks of the selection.
    If no cell or table is selected, it will just do nothing…
    Uwe
    Message was edited by: Laubender | Some language cosmetics in the alert message

  • HT201269 Hi I've been using apple products for sometime now , I have one iPad , & 2 iPhones under my apple Id but that's as I know oh and maybe an old mini iPod I lost but my question is, is there any way to check how many devices are under your apple ID

    Hi I've been using apple products for sometime now , I have one iPad , & 2 iPhones under my apple Id but that's as I know oh and maybe an old mini iPod I lost but my question is, is there any way to check how many devices are under your apple ID ?

    If you have registered all your Apple products, you can see them at:
    https://supportprofile.apple.com

  • Any way of knowing how many times a purchased playlist has been burnt?

    Is there any way of telling how many playlist burns you have left of the 7 allowed for purchased songs (playlists)?
    -Frankie

    hi,
    use STAD transaction.

  • Is there a way to find how many users are logging on to my site?

    Is there a way to find how many users are logging on to my site at a specific time?
    Thanks in advance..

    Is it possible to use an EJB3.1 Singleton beans for this too? (instead of the application context)
    Or will this create a bottleneck because of the standard write lock? It wouldn't be thread safe to provide a read lock on a user_counter increment method?

  • Is there any way to know how much time swing client is on open state?

    Is there any way to know how much time swing client is on open state? My requirement is to show a message some time after the swing client open i.e., 4-5 hours.

    You could also consider using javax.swing.Timer and java.awt.event.ActionListener (or javax.swing.Action) which takes care of running the actionPerformed code on the EDT.
    db

  • How to implement row level security using external tables

    Hi All Gurus/ Masters,
    I want to implement row level security using external tables, as I'm not sure how to implement that. and I'm aware of using it by RPD level authentication.
    I can use a filter condition in my user level so that he can access his data only.
    But when i have 4 tables in external tables
    users
    groups
    usergroups
    webgrups
    Then in which table I need to give the filter conditions..
    Pl let me know this ...

    You pull the Group into a repository variable using a session variable init block, then reference that variable in the data filters either in the LTS directly or in the security management as Filters. You reference it with the syntax VALUEOF("NQ_SESSION.Variable Name")
    Hope this helps

  • Is thr any way to know how many coloumn in  ResultSet object?

    hi madam,
    I want know how many column in result set when query like this
    "select * from table_name"
    is thr any way to know
    thank in advance

    ResultSetMetaData md = rs.getMetaData();[url http://java.sun.com/j2se/1.5.0/docs/api/java/sql/ResultSet.html#getMetaData()]http://java.sun.com/j2se/1.5.0/docs/api/java/sql/ResultSet.html#getMetaData()

  • How to know how many rows including headers and footers does subreport has from Main Report

    Hi, we are sturuggling with subreports. Main report has 3 subreports, each subreport is inplmented in a group header(3 subreports and 3 group headers). We would like to print a group header under subreport as a column header every page, and need a page break when group number is changed. This report exports a MS Excel(97-2003) report file.
    In main report, [New After Page] is checked under Group Header #1d from [Section Expert]
    In each subreport, [Repeat Group Header On Each Page] is checked under the highest group from [Group Expert]
    Here are two issues;
    Since Crystal Reports has more rows than Excel in one page, colmun header in each subreport is being printed in the middle of the page. It should be printed at the top of the page
    When Subreport has many rows and has to be printed in more than 1 page, a page break is automatically inserted before column header. It should be printed right below column header which is Group Header #1
    We have been trying to pass row counts(count of group header because group header is used as the details) using a shared variable from Subreport 1 to Subreport 2 via main report since Subreport2 cannot predict how many rows Subreport 1 has.
    Here is what we are trying but we are getting an error which is "A constant expression is required here" under main report
    - In Sunreport 1
    whileprintingrecords;
    shared numbervar SubGroupCount := DistinctCount({Table.Field});
    - In Mainreport
    shared numbervar SubGroupCount;
    if(pagenumber) = 1
    then (SubGroupCount)
    else 50
    Is there any solutionss or better ways other than above?
    Thank you,
    Main Report: Group Header #1a --> as Page Header
    Run Date: mm/dd/yyyy                                                                 Report Name
    Main Report Group Header #1b --> Subreport 1
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Main Report Goup Header #1c --> Subreport 2
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6
    Main Report Froup Header #1d --> Subreport 3
    Header 1
    Header 2
    Header 3
    Header 4
    Header 5
    Header 6

    Thank you for your reply and sorry for my complicated explanations. The report has confidential information, so I replaced to some fake data but I believe you can still see what I am trying to do..
    Main Report
    Subreport 2
    Output1
    Output2: the following page
         --> more rows are printed..
    We have two problems;
    1. The column header in Output2 is supposed to be pronted right below the last row in Output2, however, a page break is automatically inserted. But even in the same output document, it works for some group when it has a few rows..
    2. Since Crystal Reports prints more rows in one page than MS Excel does, Column header is not be printed at the top of the page.
    I tried the way you advised me but it did not work..

  • How to read any file using external tables.

    Hi folks,
    I have written an application that reads a series of csv files using external tables which works fine as long as I specify each file name in the directory i.e.......
    CREATE TABLE gb_test
    (file_name varchar2(10),
    rec_date date
    rec_name VARCHAR2(20),
    rec_age number,
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY GB_TEST
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    LOCATION ('data1.csv','data2.csv','data3.csv','data4.csv')
    PARALLEL 5
    REJECT LIMIT 20000;
    However I have discovered that I may not know the name of the files to be processed prior to the program being run so just want to read any file regardless of it's name (although it will always be a .csv file).
    Is there a way to ensure that you don't need to specify the files to be read in the LOCATION part of the syntax.
    Thanks in advance.
    Graham.

    Right, I have now completed this, however it's currently only working as SYS as opposed to any user, however here is a detail of the scenario and the steps required in case any of you guys need in the future ......
    The problem was I needed to search for csv files on my hard-drive. These files would be stored in a series of directories (a through to z), so I needed a way to read all 26 directories and process all files in these directories.
    The problem was, prior to running the program, the user would remove all the files in the directories and insert new ones, but it was never known how many he would decide to do each time.
    Solution: I created a table called stock_data_directories as follows ...
    create table stock_data_directories(sdd_rec_no number,
    sdd_table_name varchar2(50),
    sdd_directory_name varchar2(50),
    sdd_directory_path varchar2(100));
    Then inserted 26 records like ...
    insert into stock_data_directories(sdd_rec_no,sdd_table_name,sdd_directory_name,sdd_directory_path)
    values(1,'rawdata_a','KPOLLOCKA','C:\KPOLLOCK\A')
    insert into stock_data_directories(sdd_rec_no,sdd_table_name,sdd_directory_name,sdd_directory_path)
    values(2,'rawdata_b','KPOLLOCKB','C:\KPOLLOCK\B');
    etc...etc...
    Then created 26 DIRECTORIES E.G.
    CREATE OR REPLACE DIRECTORY KPOLLOCKA AS 'C:\KPOLLOCK\A';
    CREATE OR REPLACE DIRECTORY KPOLLOCKB AS 'C:\KPOLLOCK\B';
    Then created 26 external tables like the following ...
    CREATE TABLE rawdata_a
    (stock varchar2(1000),
    stock_date varchar2(10),
    stock_open VARCHAR2(20),
    stock_high varchar2(20),
    stock_low varchar2(20),
    stock_close VARCHAR2(30),
    stock_qty varchar2(20) )
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY KPOLLOCKA
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    LOCATION ('AA.csv')
    PARALLEL 5
    REJECT LIMIT 20000
    This basically says in directory rawdata_a it currently has 1 file called AA.csv.
    Then wrote a procedure as follows ...
    procedure p_process_files(pv_return_message OUT varchar2)is
    cursor c_get_stock_data_directories is
    select distinct sdd_directory_path,
    sdd_table_name
    from stock_data_directories
    order by sdd_table_name;
    vv_return_message varchar2(1000);
    begin
    -- here get the files for each directory
    for r_get_stock_directories in c_get_stock_data_directories loop
    p_build_external_table(r_get_stock_directories.sdd_directory_path,
         r_get_stock_directories.sdd_table_name,
         vv_return_message);
    end loop;
    end;
    then wrote a procedure called p_build_external_table as follows ...
    procedure p_build_external_table(pv_directory_path IN stock_data_directories.sdd_directory_path%type, -- e.g. 'C:\kpollock\A\
    pv_table_name IN stock_data_directories.sdd_table_name%type, -- e.g. rawdata_a
    pv_return_message OUT varchar2) is
    vv_pattern VARCHAR2(1024);
    ns VARCHAR2(1024);
    vv_file_name varchar2(4000);
    vv_start_string varchar2(1) := '''';
    vv_end_string varchar2(3) := ''',';
    vn_counter number := 0;
    vv_err varchar2(2000);
    BEGIN
    vv_pattern := pv_directory_path||'*';
    SYS.DBMS_BACKUP_RESTORE.searchFiles(vv_pattern, ns);
    FOR each_file IN (SELECT FNAME_KRBMSFT AS name FROM X$KRBMSFT) LOOP
    if each_file.name like '%.CSV' then
    vv_file_name := vv_file_name||vv_start_string||substr(each_file.name,instr(each_file.name,'\',1,3)+1)||vv_end_string;
         vn_counter := vn_counter + 1;
    end if;
    END LOOP;
    vv_file_name := substr(vv_file_name,1,length(vv_file_name)-1); -- remove final , from string
    execute immediate 'alter table '||pv_table_name||' location('||vv_file_name||')';
    pv_return_message := 'Successfully changed '||pv_table_name||' at '||pv_directory_path||' to now have '||to_char(vn_counter)||' directories';
    exception
    when others then
    vv_err := sqlerrm;
    pv_return_message := ' Error found updating directories. Error = '||vv_err;
    END;
    This reads every file in the directory and appends it to a list, so if it finds A.csv and ABC.csv, then using the dynamic sql, it alters the location to now read 'a.csv','abc.csv',
    It ignores all other file extentions.

Maybe you are looking for

  • Grouping all styles of a typeface in one flyout

    Hello. Some of my type families are not displaying all the font styles in a single flyout menu in the application software I use. They are all separate items in the menu, which is a detriment to productivity because of the need to constantly scroll t

  • Problem in bdc in f-22 (andreas)

    thanks andreas, it was very help full answer, thanks for it once again, t-code f-22 and f-43 iam working on 4.6c so many of fields are supressed here whike runing the bdc it shows one error many times this field doesnt exist..can u tell is there any

  • Organize / create folder in archive?

    I notice that I can not drop individual email in the archive folder but I can not create any folder in there. I'm trying to move some folders that I no longer need to see everyday in the archive folder

  • Cannot open catalog in Lightroom

    I just subscribed to Creative Cloud and downloaded Lightroom (as a replacement for Aperture). I started with the video tutorial "How to manage your digital photos". However, I cannot get Lightroom to work at all. It downloaded OK but when I opened it

  • My MacBook Pro is hanging for very long periods of time whenever I try to perform any functions.

    Hello Collective Wisdom, I have a MacBook Pro from mid-2009 and have recently experienced some problems. There's an above-average bootup time, and whenever I try to perform any functions (say, open a browser window, go into Finder, launch an app, try