Headers appear in external table

I have defined several external tables over text files that have been built in the same way - in excel, then saved as a csv file.
Most of them work fine but there is one that always returns the column headers as data. I cant understand how this happens for this one file when they are all built in the the same way. I have checked the ddl for the external tables and they are equivalent.
I realise I could set it to skip 1 row but I am loathe to do that because if this is some sort of bug then it may be resolved later resulting in the first row of data being lost - a problem that may not become obvious until found by end users.
I have tried rebuilding from scratch and get the same result.
Has anyone else faced this situation?

I don't know what the exact trick is that OWB does,
but when you sample the file you use for the external
table and tell OWB to use the first row for the
header names, it won't use the first line as a data
line, even though there's nothing to be found in the
external table definition that indicates that.Hi,
that's no trick. If you sample the file and use the first row for column names the first row only disapears in the wizard. The resulting external table definition doesn't contain a skip row statement in this case automatically. The reason why you don't recognize this is because per default the loader writes no bad files. So the header row is normally ignored (because it doesn't match the structure) and you don't find it in the external table. If you will configure your external tables based on a file with an header and a skip parameter = 0 to produce a bad file (Bad File Name = file.bad) you will find the header row in this bad file then.
The only right way ist to configure the skip parameter - not to repress the resulting errors.
In this special file I guess the header matches the structure of the external table, so it isn't ignored but loaded into the external table.
Regards,
Detlef

Similar Messages

  • 4EA3 external table default directory not appearing

    In using SQL Developer 4 Early Adopter version 3, I was attempting to set up an External Table. I created the appropriate directory object, but it did not appear in the pulldown for default directory in the create External Table dialogue.  I was able to proceed using SQL Developer 3.2. Once I created the table in SQL Developer 3.2, I was able to edit it in SQL Developer 4.

    There is a bug here in that the Dialog for the default directory should not include default directory schema (which for me defaults to the connected one).  As a workaround if you change that default directory schema to SYS in the drop down then you should see your directory. 

  • Dynamic reading headers external table

    Hi,
    I have a lot (over 200) of different databases (acces, filemaker, excel, etc) which should be converted to Oracle. An application import (not Oracle) module exists but that application is very slow in importing. I wants to try to speed up this process by loading or quering these files as an external table.
    Evey imported database has a different layout, columns etc. Also the number of columns are very high, about 80. Is there any way to dynamically read the file to be imported to extract the column names and map them as input for the create table for the external file? After that it's more easy to query that external file. In the current situation I have to create the table manually and that takes a lot of time.
    Or does anyone have a suggestion for another import proces with sqlloader, datapump, or....?
    Thanks,
    Paul

    Paul van Rixel wrote:
    Hi,
    I have a lot (over 200) of different databases (acces, filemaker, excel, etc) which should be converted to Oracle. An application import (not Oracle) module exists but that application is very slow in importing. I wants to try to speed up this process by loading or quering these files as an external table.
    Evey imported database has a different layout, columns etc. Also the number of columns are very high, about 80. Is there any way to dynamically read the file to be imported to extract the column names and map them as input for the create table for the external file? After that it's more easy to query that external file. In the current situation I have to create the table manually and that takes a lot of time.
    Or does anyone have a suggestion for another import proces with sqlloader, datapump, or....?
    Thanks,
    PaulThere is no way to dynamically read the file to be imported to extract the column names for an external table - the names must be hard-coded.
    This may be doable in a different way, however, depending on how much work you want to do and pain you're willing to endure to accomplish it.
    The easiest way is probably have a different external table for each layout with the proper definitions.
    Doing this dynamically might be possible but will probably be harder. Dynamic solutions can range from PL/SQL/Java/whatever procedures to read, parse, collect, and insert the data dynamically using data embedded in the files themselves. This will be very hard. Possiblities include using UTL_FILE and possibly pipelined functions which can use UTL_FILE internally defining table output externally.
    Some tools offer GUI interfaces to manual file loading. Apex, for instance, can read and load a file derving column names from the first record. Perhaps this is something like what you want to do
    Good luck!

  • Error while selecting date from external table

    Hello all,
    I am getting the follwing error while selecting data from external table. Any idea why?
    SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
      2        SE_CUST_ID NUMBER(38),
      3        SE_TRAN_AMT_LCY FLOAT(126),
      4        SE_REVERSAL_MARKER VARCHAR2(255))
      5  ORGANIZATION EXTERNAL (
      6    TYPE ORACLE_LOADER
      7    DEFAULT DIRECTORY ext_tables
      8    ACCESS PARAMETERS (
      9      RECORDS DELIMITED BY NEWLINE
    10      FIELDS TERMINATED BY ','
    11      MISSING FIELD VALUES ARE NULL
    12      (
    13        country_code      CHAR(5),
    14        country_name      CHAR(50),
    15        country_language  CHAR(50)
    16      )
    17    )
    18    LOCATION ('SE2.csv')
    19  )
    20  PARALLEL 5
    21  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> select * from se2_ext;
    SQL> select count(*) from se2_ext;
    select count(*) from se2_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04043: table column not found in external source: SE_REF_NO
    ORA-06512: at "SYS.ORACLE_LOADER", line 19

    It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
    HTH -- Mark D Powell --

  • Showing Text file as external table without trimming spaces

    Hi all:
    I am trying to display a text file from db sever with original spacing.
    Well it's not entirely related to APEX.
    This is how external table is created:
    create table u_x
      (rowline varchar2(255))
         ORGANIZATION EXTERNAL
           TYPE ORACLE_LOADER
           DEFAULT DIRECTORY ext_tab         <-- this is a dir i have created
           access parameters
           records delimited by newline
           fields notrim
           LOCATION ('aaa.txt')
    REJECT LIMIT UNLIMITED;
    on the first line of the aaa.text (its a report), it shows something like:
    Sat Dec 29                                                                Page 1
    but when I do select * from u_x , the result shows:
    Sat Dec 29 Page 1
    all above is done in sql workshop /sql command in APEX 4.2.1 (db 10.2.0.5)
    Is there any way to preserve the spaces between "29" and "Page"?
    (the result compressed all spaces in-between to 1 space).
    I think the ideal way is to invoke client's notepad to open the server's text file.
    anyway to generate the link?
    Thanks
    John

    Well, I have tried to download the file using below procedure.
    create or replace PROCEDURE download_bfile (
          directory_in   IN   VARCHAR2,
          file_in        IN   VARCHAR2
       AS
          lob_loc    BFILE;
          v_mime     VARCHAR2 (48);
          v_length   NUMBER(16);
       BEGIN
          lob_loc := BFILENAME (UPPER (directory_in), file_in);
          v_length := DBMS_LOB.getlength (lob_loc);
          -- set up HTTP header
          -- use an NVL around the mime type and
          -- if it is a null set it to application/octect
          -- application/octect may launch a download window from windows
          OWA_UTIL.mime_header (nvl(v_mime, 'application/octet'), FALSE);
          -- set the size so the browser knows how much to download
          HTP.p ('Content-length: ' || v_length);
          -- the filename will be used by the browser if the users does a save as
          HTP.p (   'Content-Disposition:attachment; filename="'
                 || SUBSTR (file_in, INSTR (file_in, '/') + 1)
                 || '";'
          -- close the headers
          OWA_UTIL.http_header_close;
          -- download the BLOB
          WPG_DOCLOAD.download_file (lob_loc);
          apex_application.stop_apex_engine;
       END download_bfile;
    I run it inside sql command in apex, but it does not show a pop window to save the file,
    it displays the whole text content of the file in the result window.
    Any idea why the save-as window does not pop up?
    thanks,
    John.

  • How can I make the rolumn and row headers appear on the printed sheet?

    I am working in Numbers'09. I want to print out my chart with the column letters and row numbers showing.
    How can I make the rolumn and row headers appear on the printed sheet?

    g,
    Those annotations are called "Labels", and they are only visible during editing when a cell selection is made within the table. If you need to have the labels on your final output, you can create labels in Text Boxes and position them adjacent to the table.
    Jerry

  • Remove Enter Sign in External Table

    Dear Gurus,
    I have external table with show 'enter sign'.
    I thought it was blank space but not.
    How to remove it?since function TRIM can't remove it.
    Records delimited by newline -> is that any syntax to prevent enter sign appear?
    Thank you
    Regards
    JOE

    This seems to be a TOAD issue - pl ask in the TOAD forums - http://toadworld.com/Discussions/tabid/824/Default.aspx
    HTH
    Srini

  • IGNORE COMMENTS IN EXTERNAL TABLE FILE

    I currently have a partitioned table, split by month going back some 7 years.
    The business have now agreed to archive off some of the data but to have it
    available if required. I therefore intend to select month by month, the data
    to a flat file and make use of external tables to provide the data for the
    business if required. Then to remove the months partition thus releaseing
    space back to the database. Each months data is only about 100bytes long, but
    there could be about 15million rows.
    I can successfully create the external table and read the data.
    However I would like to place a header in the spooled file but the only method
    I have found to ignore the header is to use the "SKIP" parameter. I would
    rather not use this as it hard codes the number of lines I reserve for a
    header.
    Is there another method to add a comment to a external tables file and have the
    selects on the file ignore the comments?
    Could I use "LOAD WHEN ( column1 != '--' )" as each comment line begins with a
    double dash?
    Also, is there a limit to the size of an external tables file?

    When I added the lines to attempt to
    exclude the Header lines to be:
    RECORDS DELIMITED BY newline
    NOBADFILE
    NODISCARDFILE
    NOLOGFILE
    SKIP 0
    LOAD WHEN ( cvt_seq_num LIKE '--%' )
    FIELDS
    TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    MISSING FIELD VALUES ARE NULL
    REJECT ROWS WITH ALL NULL FIELDS
    ( cvt_seq_num INTEGER EXTERNAL(12)
    I got:
    select * from old_cvt_external
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPENcallout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "identifier": expecting one of: "equal,notequal"
    KUP-01008: the bad identifier was: LIKE
    KUP-01007: at line 6 column 33
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    When I moved the line I got:
    RECORDS DELIMITED BY newline
    NOBADFILE
    NODISCARDFILE
    NOLOGFILE
    SKIP 0
    FIELDS
    TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    MISSING FIELD VALUES ARE NULL
    REJECT ROWS WITH ALL NULL FIELDS
    LOAD WHEN ( cvt_seq_num LIKE '--%' )
    I got:
    select * from old_cvt_external
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "load": expecting one of: "exit, ("
    KUP-01007: at line 11 column 11
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    So it appears that the "LOAD WHEN" does not work.
    Can you please suggest anything else?

  • Oracle External Table SELECT FROM problem from workstation

    At Solaris Oracle database server console.
    Created directory on the Solaris server as Oracle owner.
    As SYS created oracle directory object on that Solaris directory
    Granted read/write to SCHEMA_OWNER on that oracle directory object.
    Using OS Oracle user, moved a tab-delimited flat file into the Solaris directory.
    Logged on a SCHEMA_OWNER using SQLPLUS on the Solaris database server.
    Ran external table script in SQLPLUS.
    External table was created.
    Ran Select * from ext_table.
    Appropriate dataset returned.
    So at the Oracle Solaris server console,
    the create external table script worked without errors,
    and a select from statement on the external table worked without errors.
    Move to developer workstation:
    Logged on as SCHEMA_OWNER using SQLPLUS on Windows workstation.
    TNSNAMES of course points to the Solaris database server.
    Ran the external table script in SQLPLUS.
    External table was created.
    Ran Select * from ext_table.
    This failed with these errors:
    ORA29913 error executing ODCIEXTTABLEOPEN callout
    ORA29400 data cartridge error
    cant open logfile.log
    OS permission denied
    ORA06512 sys.oracle_loader line 19
    So how can I select from external tables from a windows workstation?
    Any guidance on this problem would be appreciated.

    Thank you for your response.
    I am not creating the external table on the workstation.
    In both cases,
    from the Solaris console
    and from the Windows workstation
    the external table is being created on the Solaris file system
    in an Oracle Directory object
    running an SQL script from SQLPLUS prompt.
    The external table creator, schema owner, has read and write permissions
    granted by SYS on the oracle directory object.
    The problem is:
    Logged in as the schema owner,
    you can select * from ext_table from the Solaris console SQLPLUS,
    but you can not select * from ext_table from the Windows workstation SQLPLUS.
    You can DROP TABLE ext_table from the Windows workstation SQLPLUS.
    You just cannot select * from ext_table from the Windows workstation SQLPLUS.
    I guess as a test,
    I can drop from the ext_table creation script the references
    to discardfile, badfile, and logfile,
    and remove this other file objects from the equation...
    which appears to be a file permissions problem.

  • Problem with external tables

    Hi
    I able to create external tables ,but unbale to query
    I had followed the below steps
    sql> conn system/manager;
    Connected
    SQL> select * from emp;
    EMPNO ENAME DEPTNO
    100 mmm 10
    200 yyy 20
    300 zz 30
    SQL> spool emp.dat
    SQL> select empno ||','||ename||','||deptno from emp;
    EMPNO||','||ENAME||','||DEPTNO
    100,mmm,10
    200,yyy,20
    300,zz,30
    sql>create directory x as 'd:\oracle\y'
    Directory is created
    SQL> create table ext(empno char(4),ename char(10),deptno char(2))
    2 organization external (type oracle_loader default directory x access
    parameters(fields terminated by ','
    3 (empno,ename,deptno))
    4 location('emp.dat'));
    Table created.
    SQL> select * from ext;
    select * from ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file emp.dat in x not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    Thanks inadvance
    Mohan

    Yea - there's nothing here that shows that you are pointing at that dir when you do the spool command.
    Also, the headers went into the file. There should only be data. Edit the file and clean it up.
    Maybe start with a very simple hand-edited file with 1 field, and get that to work.
    Tom Best

  • Problem with file used by external table

    Hi all,
    following situation:
    I am creating my file on unix/solaris and ftp it to oracle server which is running on windows.
    I am getting following error when I try to do select on the external table I get:
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-29400: data cartridge error
    KUP-04020: found record longer than buffer size supported, 524288, in D:\corona\flat_files\input\CORE.PROGRESS.TXT
    ORA-06512: at "SYS.ORACLE_LOADER", line 52
    But it is working when I do following:
    File->Conversions->UNIX/MAC to DOS-> Save it and ftp to windows server.
    I have already tried to call unix2dos in my shell script, but I keep getting the same error.
    Here is the CREATE TABLE:
    CREATE TABLE EXT_TRACKING_DATA_PROGRESS
    TRACKING_ID VARCHAR2(19 BYTE),
    COMPANY_ID VARCHAR2(19 BYTE),
    SUPPLIER_ID VARCHAR2(1 BYTE),
    TRACKING_ID_TYPE VARCHAR2(2 BYTE),
    START_DATE VARCHAR2(10 BYTE),
    END_DATE VARCHAR2(10 BYTE),
    BLANK VARCHAR2(100 BYTE)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY DIR_INPUT
    ACCESS PARAMETERS
    ( fields terminated BY '@|@' )
    LOCATION (DIR_INPUT:'CORE.PROGRESS.TXT')
    REJECT LIMIT 0
    NOPARALLEL
    NOMONITORING;

    Are you FTP-ing the file to the Windows machine in ASCII mode? Or in binary mode? Binary mode won't convert the line breaks from Unix to Windows, which would appear to be the problem.
    Justin

  • External Table in a XDB Resource

    Hi,
    is it possible to create an external table in a XDB resource (i.e. /home/public) like in a normal directory?
    Thanks in advance
    Best regards
    Martin

    Martin,
    Here is another article by Jonanthan Gennick.
    http://www.oracle.com/technology/oramag/oracle/03-may/o33xml.html
    Foldering an XML View
    One particularly exciting XML-related feature in Oracle9i Release 2 is that you can use a SQL/XML query such as I've been developing in this article as the basis for creating an XMLType view. You can then "folder" that view so that its contents appear as XML files in a directory in the XML DB Repository. Next Steps
    Whenever you open one of those XML files using Internet Explorer or an application such as Microsoft Excel, the file's contents are constructed on the fly by executing the query to create that particular XMLType view. The Microsoft Office XP version of Microsoft Excel supports an XML file format, so if you generate an XMLType view using the XML schema that Excel expects, you can open spreadsheets containing current data, fresh from the database.
    Listing 4 shows an XMLType view made from the query developed in this article. (Note that this particular CREATE VIEW statement and the foldering feature work only in Oracle9i Database Release 9.2.0.2 or higher.) The OBJECT ID clause in the CREATE VIEW statement generates a unique object identifier for each row in the view. The view returns one XML document (one row) per county, with that document listing all of that county's attractions. The reference to sys_nc_rowinfo$ that you see in the extractValue function is a reference to the "current" row in the view. The XPath query syntax '/County/@Name' causes extractValue to return the value of the Name attribute in each <County> element, which is then used as the basis for generating a unique identifier for each row returned by the view.
    The view alone is not enough to make the XML documents appear in the repository. It's also necessary to create repository resources, which show up as documents, and to tie each resource to an object identifier. The PL/SQL block in Listing 5 does this for the attraction_xml view. Note that it's not even necessary to query the view. The code in Listing 5 opens a cursor to retrieve all distinct county names from the attraction table on which the view is based. A call to the MAKE_REF function then generates a REF to each county's row in the view's result set. Finally, this REF is used in a call to DBMS_XDB.createResource. The createResource function creates a resource in the XML DB Repository and links that resource to the data for the given county in the view's result set. The resource appears as a .xml file in the repository.
    Note that before running the code in Listing 5, you need to create a folder named /ATTRACTIONS in your repository. It's in that folder that the PL/SQL code creates the XML documents that refer to the view.

  • Dynamically Update External Table Data

    I loaded a data table from an external csv file. But the csv file is an output from a program that appends a new line to the csv file every couple days.
    I made a Report with the loaded data, but in a couple days when a few new lines of data appear in the csv file, I want my report to update as well.
    Is there a way to create a "Refresh Button" in my application that will load the data from the csv when pressed?
    I have oracle database 11g express with APEX 4.1.1

    Hi,
    what you describe could certainly be achieved, but it would have to be designed and built, it is not going to be provided "out of the box". I would probably go with an external table based on your file and a process that you would build would be callable from the button and this would do some sort of a merge of the external table data into your database table. Apart from being callable on demand, the process could also be made to be a scheduled process that loads the data on a regular basis, say once a day or once an hour, depending on your requirements. To use an external table it is assumed that the file will be available on the database server. If not and the file is available on only a client machine, then doing an on demand load process would still be possible, but a little more difficult.
    Andre

  • Mysterous error external table

    I have defined a simple external table :
    create table ext_tab_test (
    a number
    , b number
    , c number
    organization external (
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ';'
    missing field values are null
    location ('test')
    reject limit unlimited
    where ext_dir points to a directory on HP-UX with read, write permissions, and file "test" is owned by user oracle and all permissions to world.
    Still I got the error:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00552: internal XAD package failed to load
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    I have Googled on the combination of KUP-00552 and ORA-06512, but I only got a single hit that is a page of Oracle Japan in Japanese.
    I could not find any clue about the cause of this problem.
    When I use ORACLE_DATAPUMP, I do not encounter any problems:
    create table export_test2
    organization external
    ( type oracle_datapump
    default directory ext_dir
    location ('test2') )
    as select * from dual
    create table import_test2
    ( dummy varchar2(1)
    organization external
    ( type oracle_datapump
    default directory ext_dir
    location ('test2')
    /

    See MetaLink Note:373168.1
    Cause
    The issue is likely caused by Bug 5172459: 'KUP-00552 WHEN QUERYING EXTERNAL TABLES IN 10.2.0.2'
    which is still open and active.
    According to Bug 5172459, the problem appears to be that the messages file for external tables ( kup<lang>.msb ) for non-english systems
    Solution
    Need to replace the language specific (non-english) kup<lang>.msb file with the english version.
    1. cd $ORACLE_HOME/rdbms/mesg
    2. Replace <lang> with your installed languages file.
    mv KUP<lang>.msb to KUP<lang>.msb.BAK
    3. Copy <us> version over current <lang> copy of kup msb file.
    cp kupus.msb to KUP<lang>.msb
    4. re-run the select against the external table

  • Validate External Table Fails

    Hi there,
    I am new to WB and I am trying to setup a simple project to read from a data file and populate a database table. I have create a 2 locations, a database and the other a file location. I have created a module and have created the external table, and imported the other database table. I already have an external table in my database that reads the data file, but was unable to import it for some reason when I did so it didn't appear, so I created it again in WB. Having done so if I perform validation on it, by right clicking, I get the following error
    VLD-0187: The location is not configured for for module MY_MODULE.
    Specify a location in the configuration for the database module. Locations must be specified as data locations in the Module Editor to appear in the configuration location selection list.
    Does anybody know what this means? The database module under which I have created my external table and imported my table uses the database location I have created, and my extrenal table uses the file location I have created.
    Any help would be much appreciated
    thanks, Anil

    OK there are few thing that need to be set:
    1. MY_MODULE is your Schema (module) in OWB Project explorer --> Double clicking on it opens 2 tabs for locations
    -- 1. Metadata location --> this is your connection to DB
    -- 2. Data locations --> this is where data is/will be located
    2. In connection explorer you need to have 2 connections
    -- 1. DB connection --> this is your connection to DB
    -- 2. File locations --> this is directory where your files are
    3. Double click on your External table --> tab Location --> set file location
    Do you have all of these set?

Maybe you are looking for