How to ''give'' error for this case of an EXTERNAL TABLE?

Our external table routine works fine:
-- We have a csv file with 2 cols.
-- When we create the table referring the csv it works fine.
-- Even if the csv has more the 2 cols, the ET command only takes the 2 cols and it works fine.
-- Now, users are saying that if the csv has more than 2 cols, the ET command should give an error
I went through the command but cannot find any clause which will do this.
Is there any other way or workaround?
CREATE TABLE <table_name> (
<column_definitions>)
ORGANIZATION EXTERNAL
(TYPE oracle_loader
DEFAULT DIRECTORY <oracle_directory_object_name>
ACCESS PARAMETERS (
RECORDS DELIMITED BY newline
BADFILE <file_name>
DISCARDFILE <file_name>
LOGFILE <file_name>
[READSIZE <bytes>]
[SKIP <number_of_rows>
FIELDS TERMINATED BY '<terminator>'
REJECT ROWS WITH ALL NULL FIELDS
MISSING FIELD VALUES ARE NULL
(<column_name_list>))\
LOCATION ('<file_name>'))
[PARALLEL]
REJECT LIMIT <UNLIMITED | integer>;
Is it possible to use the READSIZE?
Edited by: Channa on Sep 23, 2010 2:28 AM

-- Now, users are saying that if the csv has more than 2 cols, the ET command should give an error
I went through the command but cannot find any clause which will do this.
Is there any other way or workaround?I looked at Serverprocess' sql*loader script and did not see how that would answer your question - how to raise an error if the file has more than 2 columns. If I missed something can Serverprocess explain?
I can't think of a direct way to do this with your external table either, but there may be indirect ways. Some brainstorming ideas of perhaps dubious usefulness follow.
Placing a view over the external table can limit results to the first two columns but won't raise an error.
A pipelined function can read the external table, check for data where there shouldn't be any, and raise an exception when you find data in columns where there should not be any.
Similarly, you could ditch the external table and use utl_file to read the file, manually parsing and checking the data. LOTS more work but more control on your end. External tables are much easer to use :(
Or, first load the external table into a work table before the "real" select. Check the work table for the offending data programatically and raise an error if data is where it should not be. You could keep the existing external table and not have to do a lot of recoding.
Or, also load the data into an otherwise unneeded global temporary table first. Use a trigger on the load to look for the unwanted data and raise an error if offending data is there
These ideas are boiling down to variations on validating the data before you use it.
Good luck!

Similar Messages

  • How to use to_date for this case?

    Hi,
    I bind parameters in java code.
    The param type in java is Timestamp and the data type in table is date.
    Here is the sql section printted in log:
    2004-08-01 10:00:00.0 <= table.datetime
    Why there is a ".0" after second?
    And how to use to_date to convert "2004-08-01 10:00:00.0"?
    Thanks!

    Hi,
    Here are a few possibilities
    SQL> select cast(timestamp '2004-08-01 10:00:00.0' as date) from dual;
    CAST(TIMESTAMP'2004
    2004-08-01 10:00:00
    SQL> select to_date('2004-08-01 10:00:00.0','YYYY-MM-DD HH24:MI:SS".0"') from dual;
    TO_DATE('2004-08-01
    2004-08-01 10:00:00
    SQL> select to_date(substr('2004-08-01 10:00:00.0',1,19), 'YYYY-MM-DD HH24:MI:SS') from dual;
    TO_DATE(SUBSTR('200
    2004-08-01 10:00:00

  • How to give error message for the screen element text field when wrong i/p

    How to give error message for the screen element text field when wrong i/p
    when wrong input given
    eg. 
    I have a text box with SBOOK-CARRID
    so when user give wrong entry in text box i.e LG
    then I should give some error stating that the the input is invalid or not available ,
    now it showing the error of standard messages,
    i want manual message to be displayed when error comes.
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla

    Hi all,
    Thank you for your valuable reply,
    but the thing is that its a screen field,
    i.e text box not a selection screen
    i created in screen layout
    with name sbook-carrid
    now i want to get error message display if wrong i/p is given
    thank you.
    Regards,
    Jagrut bharatkumar Shukla,

  • Apple Logo and Progress Bar Stuck 1 out of 5 while Restoring my iPhone 5 to iOS8. How can i Do for This Problem. Sometime iTunes say An Unknown error occured (error -14)

    Apple Logo and Progress Bar Stuck 1 out of 5 while Restoring my iPhone 5 to iOS8. How can i Do for This Problem. Sometime iTunes say An Unknown error occured (error -14) iTunes Version is 11.4

    The error that you are seeing has to do with your Internet connection. Try disabling your anti-virus software and connect the iPhone again and try to restore. See this support document for help. http://support.apple.com/kb/HT1808

  • Files generated by Web Service Proxy give errors for complex input types

    Hi ,
    I generated a Java Web Service Proxy using a WSDL file.
    The input params are of this fashion -
    1) Object 1 have 3 attributes
    2) Object 2 having nested Object 2 (yes , again) which has a nested attribute which needs to be passed say Param 1.
    When I generate the proxy classes ... Param 1 is referred to as private Object2.Object2 param1 which gives error for the data types.
    How can we resolve this .. what should be the correct data type representation for param 1 ?
    Thanks

    Issue was resolved . Details here - 11g PS2 - WebServiceProxy Class give errors for complex input types

  • How to give comments for a particular table

    hi..
    how to give comments for a particular table ..
    select * from user_tab_comments;
    tx in advance..

    Try this.
    SQL> COMMENT ON TABLE EMP IS 'THIS IS SAMPLE EMPLOYEE TABLE' ;
    Comment created.
    SQL> select * from user_tab_comments where table_name = 'EMP'
      2  /
    TABLE_NAME                     TABLE_TYPE
    COMMENTS
    EMP                            TABLE
    THIS IS SAMPLE EMPLOYEE TABLE

  • How to give authorization for create and change particular Condition Type

    Hi...
       In my requirement is , Only one user can be authorized to create and change a particular condition type 'ZABC' in vk11 and vk12 .
    For remaining condition type can be used as in normal .
    How to do this ? How to give authorization for a particular user for particular condition type ?
    Plz guide me ..
    Thanks in advance .
    Deepa .

    Hi Deepa ,
    u can check A.Object V_KOND_VEA, in user profile u can assign condition type or tables.
    have a word with ur basis guy , so he can help u in better way.
    aand also ref FM SD_COND_AUTH_CHECK
    Regards
    Prabhu

  • How to write query for this in TopLink ?

    I am doing a simple search in jsp where the search will the based on the choices chosen by user.
    I had given 3 check boxes for those choices.
    The problem is, query will be based on the choice or choices chosed by the user.
    How to write query for this in TopLink ?
    Thanks in Advance..
    Jayaganesh

    Try below solution, it is NOT best solution but might work:
    Declare @Questions TABLE (QuestionID INT, QuestionText Varchar(100))
    INSERT INTO @Questions
    VALUES (1, 'Comment'), (2, 'Score')
    DECLARE @Answers TABLE (authkey INT, QuestionID INT, questiontext VARCHAR(100), answertext VARCHAR(100))
    INSERT INTO @Answers
    VALUES (101, 1, 'comment', 'hi!!'), (101, 2, 'score', '4'), (102, 1, 'comment', 'excellent'), (102, 2, 'score', '5'), (103, 2, 'score', '6'), (104, 2, 'score', '8')
    SELECT
    A.AuthKey
    ,Q.QuestionID
    ,Q.QuestionText
    ,A.AnswerText
    FROM
    @Questions Q
    INNER JOIN @Answers A ON Q.QuestionID = A.QuestionID
    UNION
    SELECT
    A.AuthKey
    ,Q.QuestionID
    ,Q.QuestionText
    ,Null
    FROM
    @Questions Q
    CROSS JOIN @Answers A
    WHERE
    NOT EXISTS (SELECT 1 FROM @Answers SubQry WHERE SubQry.AuthKey = A.AuthKey AND SubQry.QuestionID = Q.QuestionID)
    Output
    AuthKey | QuestionID
    | QuestionText
    | AnswerText
    101 | 1 | Comment | hi!!
    101 | 2 | Score | 4
    102 | 1 | Comment | excellent
    102 | 2 | Score | 5
    103 | 1 | Comment | NULL
    103 | 2 | Score | 6
    104 | 1 | Comment | NULL
    104 | 2 | Score | 8
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • Warning: There are Java errors for this object. The wizard will be read only until they are corrected.

    when I try to open seeded VO.xml from Jdeveloper it is giving below error. Can any one please help me out.
    Warning: There are Java errors for this object. The wizard will be read only until they are corrected.
    R12 version 12.1.3
    Jdev patchp9879989_R12_GENERIC.zip
    Thanks
    Venkata .T

    Hi Venkata,
    Same thing happening to me, R12.1.3. Please let me know if you find anything on this.
    I tried some steps in this forums related to this, but no change. however I am not worried, customization works perfect after extension, but wanted to know the reason.
    Thx..

  • Warning: There are java errors for this object. The wizar will be read-only

    I migrate JDev9 to JDev10 and if open any module show message:
    "Warning: There are java errors for this object. The wizard will be read-only util they are corrected."

    [Solved, sort of] view objects read only mode
    The Oracle fix the problem?
    Message was edited by:
    oracle_user7

  • Warning : There are JAVA errors for this object .This wizard will be read

    Hi All,
    I am getting this error when trying to open the standard VO or AM's .
    Warning : There are JAVA errors for this object .This wizard will be read only until they are corrected.
    Please help me on this.
    Thanks

    Decompile the VOImpl and AmImpl class files and keep the .java files in myprojects folder under appropriate package structure and try.
    -Anand

  • TS4009 I upgraded my Icloud storage yesterday by 10GB, but one day later realize I did not need to do so.  The apple advice is to cancel within 15 days for a refund, but does not tell you how to do so.  Anyone know how to contact apple for this purpose?

    I upgraded my Icloud storage yesterday by 10GB, but one day later realize I did not need to do so.  The apple advice is to cancel within 15 days for a refund, but does not tell you how to do so.  Anyone know how to contact apple for this purpose?

    You would have to contact Apple in order to do that. Just use this link to ask Apple for a refund: http://www.apple.com/support/contact/

  • How do you set up csv as an oracle external table

    How do you set up csv as an oracle external table?

    Hi,
    >>where do I specify which csv file to read from the external table..
    Please, read either the link provided by Andrew or the link that I have posted in my previous post.
    "# DEFAULT DIRECTORY - specifies the default location of files that are read or written by external tables. The location is specified with a directory object, not a directory path. See Location of Datafiles and Output Files for more information.
    # LOCATION - specifies the location of the external data. The location is specified as a list of directory objects and filenames. If the directory object is not specified, then the default directory object is used as the file location."
    Cheers
    Legatti

  • How to fix "Licensing for this product has stopped working - Error 150:30"?

    I cannot pen PSE or Bridge. It get the message "Licensing for this product has stopped working - Error 150:30".
    I assume it is because I recently upgraded my Mac to Yosemite.
    What do I need to do to be able to open PSE again?
    Thank you.

    Thank you. I appreciate your tips. I tried solution 5 and it doesn't work.
    The rest is essentially gibberish to a basic user like myself. I have
    neither the expertise nor the confidence to go into these folders and start
    mucking around in there. Can I please have someone call me and guide
    through the necessary steps. My number is 06 46 40 94 39 (Location: France).
    Cheers.
    Michel Payen-Dumont & Nancy Feyerer
    www.gaulejac.blogspot.com
    Tél.: 05 53 50 72 80
    M: 06 46 40 94 39
    N: 06 45 29 59 40

  • How to build DTD for this element

    How to write DTD for an element which has character data and child element?
    I am trying to write DTD for "paycode" element:
    <paycode lookup="name" source="RT">OT
      <rate type="BASERATE">1.0</rate>
    </paycode>So i have written this so far:
    <!ELEMENT paycode (rate)>
    <!ATTLIST paycode
         lookup (name|code) "code"
         source CDATA #REQUIRED>Where I am going to specify that paycode has character data as well (in my xml its "OT")?
    Thanks

    But when i define my xml as :
    <rules>
    </rules>
    and open it in IE 6.0, the Internet Explorer doesnot
    give me any error message. Any reason?Is the InternetExplorer supposed to validate your XML
    ? I doubt that.
    The XML in itself is valid as long as it matches the
    basic XML syntax rules ("well-formed"). The structure
    matters only when it gets validated against a
    DTD.On http://www.w3schools.com/dtd/dtd_validation.asp webiste it said that "Internet Explorer 5.0 can validate your XML against a DTD."

Maybe you are looking for

  • Error when adding a database

    Hi I keep getting this error "Index was outside the bounds of the array. (microsoft.SQLserver.Smo)" when adding a new database. How can I fix this Thanks

  • Final Cut Pro Training

    I am currently looking to get Apple certified on FCP. The training classes will cost me around $3800. My question, is it worth it??? If I can achieve a Apple Certification in FCP, will that help me with my career and job search??? Would anyone sugges

  • Dashboard pages within dashboard

    Hi All, We can create Dashboards within a group as a dropdown by making changes in instanceconfig file, but is it possible to have dashboard pages within a dashboard as a dropdown.

  • N70 Image gallery 'Corruption'

    Can anybody help:- All of a sudden, my N70 told me my image gallery was corrupted and my pictures, of which there were many, have been removed. Does anybody know: 1) What would have caused this? 2) How to get my pictures back? 3) How to prevent this

  • MST region and instances

    Dear All, I have a query regarding MST, I have attached the topology, i am suing 4500 switches as the CORE in the LAn network and many 2960,3850 as access switches, am also using Nexus switches. I would like to use Multiple spanning tree(MST) in the