External table causing error on count(*)

I created an external table, when i do count(*) from the table
it is giving me the error :
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04018: partial record at end of file
here is my definition for the file :
CREATE TABLE ext_tab
TYPEVENDORCODE VARCHAR2(4000 BYTE),
VENDORCODE VARCHAR2(4000 BYTE),
WRKCODEWRKDONEFHA VARCHAR2(4000 BYTE),
FILLER4 VARCHAR2(4000 BYTE),
TYPECODEVENDOR VARCHAR2(4000 BYTE),
FILLER6 VARCHAR2(4000 BYTE),
FILLER7 VARCHAR2(4000 BYTE),
TYPE VARCHAR2(4000 BYTE),
FILLER9 VARCHAR2(4000 BYTE),
COST VARCHAR2(4000 BYTE),
PHOTOS VARCHAR2(4000 BYTE),
SUBJECTTODISCOUNT VARCHAR2(4000 BYTE),
FHAREGION VARCHAR2(4000 BYTE),
AVERAGECOST VARCHAR2(4000 BYTE),
FILLER15 VARCHAR2(4000 BYTE),
FILLER16 VARCHAR2(4000 BYTE),
FILLER17 VARCHAR2(4000 BYTE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY dir1
ACCESS PARAMETERS
( RECORDS FIXED 512
SKIP 1
READSIZE 3840000
BADFILE 'STG0_FILE71_EXT.BAD'
LOGFILE 'STG0_FILE71_EXT.LOG'
FIELDS TERMINATED BY 0x'0A'
NOTRIM
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
typevendorcode CHAR(4000),
vendorcode CHAR(4000),
wrkcodewrkdonefha CHAR(4000),
filler4 CHAR(4000),
typecodevendor CHAR(4000),
filler6 CHAR(4000),
filler7 CHAR(4000),
type CHAR(4000),
filler9 CHAR(4000),
cost CHAR(4000),
photos CHAR(4000),
subjecttodiscount CHAR(4000),
fharegion CHAR(4000),
averagecost CHAR(4000),
filler15 CHAR(4000),
filler16 CHAR(4000),
filler17 CHAR(4000)
LOCATION (dir1:'abc.DAT.raw')
REJECT LIMIT UNLIMITED
NOPARALLEL
NOMONITORING;
any thoughts?
billu

I don't think there is any way to modify your table definition to accommodate the (apparent) fact that missing values generate nothing in the file you want to load.
It seems that you are saying that the format of the file is not actually fixed in any way, that is has some, but not all values, and that mising values are just skipped.
Assuming for a moment that the fields are delimited bt a pipe symbol (|) then it seems to me that you have this situation :
Defined file format:
ID|name|age|addresswhich would imply the file should look like:
123|John|42|123 MainSt.
456|Fred|39|45 Pine St.but sometimes you get:
12345|27|12 Elm St.If this is the case, there is no possible way that the file can be reliably parsed since there is no consistnet format. If field values could be missing, you need to get whoever generates the file to do something more like:
12345||27|12 Elm St.That is, put in the field delimiters even if there is no value for the field.
John

Similar Messages

  • XML File in External Table - OS error permission denied.

    Hi.
    10g R2, Red Hat Linux
    I'm using the article (see below, taken from http://www.dbazine.com/olc/olc-articles/scardina1 by Mark Scardina) to create an external table where I'd store my XML file.
    So, I
    1. Created a directory xmlfile_dir
    2. Granted access to needed db user
    3. Created the table
    CREATE TABLE relayxml_xt (doc CLOB)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY xmlfile_dir
    ACCESS PARAMETERS
    FIELDS (lobfn CHAR TERMINATED BY ',')
    COLUMN TRANSFORMS (doc FROM lobfile (lobfn))
    LOCATION ('xml.dat')
    REJECT LIMIT UNLIMITED;
    4. mv relay.xml /xmlfile_dir/xml.dat
    When I run SELECT * FROM relayxml_xt I get this:
    Error starting at line 1 in command:
    select * from relayxml_xt
    Error report:
    SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file RELAYXML_XT_28773.log
    OS error Permission denied
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    29913. 00000 - "error in executing %s callout"
    *Cause:    The execution of the specified callout caused an error.
    *Action:   Examine the error messages take appropriate action.
    What am I doing wrong?
    Thanks,
    Using External Tables
    Introduced in Oracle9i, Oracle’s external table feature offers a solution to define a table in the database while leaving the data stored outside of the database. Prior to Oracle Database 10g, external tables can be used only as read-only tables. In other words, if you create an external table for XML files, these files can be queries and the table can be joined with other tables. However, no DML operations, such as INSERT, UPDATE, and DELETE, are allowed on the external tables.
    Note: In Oracle Database 10g , by using the ORACLE_DATAPUMP driver instead of the default ORACLE_DRIVER, you can write to external tables. In Oracle Database 10g, you can define VARCHAR2 and CLOB columns in external tables to store XML documents. The following example shows how you can create an external table with a CLOB column to store the XML documents. First, you need to create a DIRECTORY to read the data files:
    CREATE DIRECTORY data_file_dir AS 'D:\xmlbook\Examples\Chapter9\src\xml';
    GRANT READ, WRITE ON DIRECTORY data_file_dir TO demo;
    Then, you can use this DIRECTORY to define an external table:
    CREATE TABLE customer_xt (doc CLOB)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY data_file_dir
    ACCESS PARAMETERS
    FIELDS (lobfn CHAR TERMINATED BY ',')
    COLUMN TRANSFORMS (doc FROM lobfile (lobfn))
    LOCATION ('xml.dat')
    REJECT LIMIT UNLIMITED;
    The xml.dat file follows:
    customer1.xml
    customer2.xml
    If you describe the table, you can see the following definition:
    SQL> DESC customer_xt;
    Name Null? Type
    DOC CLOB
    Then, you can query the XML document as follows:
    SELECT XMLType(doc).extract('/Customer/EMAIL')
    FROM customer_xt;
    Though the query requires run-time XMLType creation and XPath evaluation, this approach is useful when applications just need a few queries on the XML data and don’t want to upload the XML data into database. In Oracle Database 10g, you cannot create external tables that contain pre-defined XMLType column types.
    Message was edited by:
    vi2167

    Your don't have the proper operating system privileges. Be sure that you (=oracle OS user / the OS Linux user that is starting the database) are allowed have read privs on the path and/or file.
    for example...
    chown -Rf /xxxxxxx/xxxx/etc
    ls -l file.xml
    file.xml    oracle:oinstall    rw-rw-rw

  • Table creation Error "Ref Count for this object is higher than 0"

    Hi All
    I have a problem in creation of table using SDK on a button event.  I have a procedure to create tables and fields. If I call this procedure on a menu Event than it works fine but If I call this procedure on a button event than It gives error "Ref count for this object is higher than 0" . I know this error occur When an object does not release after creating a table. but this error occur at when first table is created. My code it given below. plz see and give me your valuable suggestions.
      Dim oUserTablesMD As SAPbobsCOM.UserTablesMD
                Try
                    oUserTablesMD = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
                    oUserTablesMD.TableName = "AM_OBIN"
                    oUserTablesMD.TableDescription = "PutAway Table"
                    oUserTablesMD.TableType = BoUTBTableType.bott_Document
                    lRetCode = oUserTablesMD.Add
                    '// check for errors in the process
                    If lRetCode <> 0 Then
                        B1Connections.diCompany.GetLastError(lRetCode, sErrMsg)
                        MsgBox(sErrMsg)
                    Else
                        B1Connections.theAppl.StatusBar.SetText("Table: " & oUserTablesMD.TableName & " was added successfully", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success)
                    End If
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserTablesMD)
                    oUserTablesMD = Nothing
                    GC.Collect()
                    oUserTablesMD = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
                    oUserTablesMD.TableName = "AM_BIN1"
                    oUserTablesMD.TableDescription = "PutAway Upper Grid"
                    oUserTablesMD.TableType = BoUTBTableType.bott_DocumentLines
                    lRetCode = oUserTablesMD.Add
                    '// check for errors in the process
                    If lRetCode <> 0 Then
                        If lRetCode = -1 Then
                        Else
                            B1Connections.diCompany.GetLastError(lRetCode, sErrMsg)
                            MsgBox(sErrMsg)
                        End If
                    Else
                        B1Connections.theAppl.StatusBar.SetText("Table: " & oUserTablesMD.TableName & " was added successfully", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success)
                    End If
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserTablesMD)
                    oUserTablesMD = Nothing
                    GC.Collect()
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try
    Thanks
    Regards
    Gorge

    Hi Gorge,
    The "Ref count error..." usually occurs in case of Meta Data objects not being properly cleared.  And yes, you have got the error in the right place, generally while creating tables / fields / UDOs.  For this, you just need to clear the Meta Data object (At times even DI objects like Record Set) once they are used.
    Eg: Release these objects in the below way in a Finally Block.
    System.Runtime.InteropServices.Marshal.ReleaseComObject(oRecordSet);
    Hope this helps.
    Regards,
    Satish

  • External Tables Date Error

    I get error while loading data into Oracle 11g R2 with EXTERNAL TABLES.
    error processing column DATE_M in row 1 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01847: day of month must be between 1 and last day of month
    error processing column DATE_M in row 2 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01843: not a valid month
    error processing column DATE_M in row 3 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01843: not a valid month
    error processing column DATE_M in row 4 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01847: day of month must be between 1 and last day of month
    error processing column DATE_M in row 5 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01843: not a valid month
    error processing column DATE_M in row 6 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01843: not a valid month
    error processing column DATE_M in row 7 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01843: not a valid month
    error processing column DATE_M in row 8 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01843: not a valid month
    error processing column DATE_M in row 9 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01843: not a valid month
    error processing column DATE_M in row 10 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
    ORA-01843: not a valid month-----
    CREATE TABLE TABLE_EXT
       (  "COMPANY" VARCHAR2(101),
      "COMPANY_VN" VARCHAR2(15),
      "IL" VARCHAR2(17),
      "TERMINAL" VARCHAR2(8),
      "T_NO" VARCHAR2(15),
      "NAME" VARCHAR2(108),
      "SNAME" VARCHAR2(50),
      "REF_NO" VARCHAR2(23),
      "AMOUNT" NUMBER(15,2),
      "DATE_M" DATE,
      "TIME" VARCHAR2(11),
      "TEL_NO" VARCHAR2(25),
      "ADDRESS" VARCHAR2(50)
       ORGANIZATION EXTERNAL (
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY data_pump_dir
      ACCESS PARAMETERS (
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY '|'
        MISSING FIELD VALUES ARE NULL
    COMPANY,
    COMPANY_VN,
    IL,
    TERMINAL,
    T_NO,
    NAME,
    SNAME,
    REF_NO,
    AMOUNT decimal  ,
    DATE_M CHAR  date_format DATE mask "dd.mm.yyyy" ,
    TIME,
    TEL_NO,
    ADDRESS
      LOCATION ('TABLE_EXT.txt')
    REJECT LIMIT 10------
    Sample Data:
    CITY HOSPITAL|04680072124|CITY|00614860|47746244218|JOHN|WHITE|172871|420,12|21.08.2011|14:26|0806422627784|06
    CITY HOSPITAL|04680072124|CITY|00614847|14274017676|BRAD|BROWN|448127|810,00|22.08.2011|11:04|0806427488476|06
    CITY HOSPITAL|04680072124|CITY|00614842|16218778886|PETER|BALSON|862626|12,00|24.08.2011|14:16|0806062177008|06
    CITY HOSPITAL|04680072124|CITY|00614846|14607666866|GEORGE|LOUIS|688811|40,10|24.08.2011|08:48|0806424172468|06
    CITY HOSPITAL|04680072124|CITY|00614846|14607666866|GEORGE|LOUIS|460481|42,64|24.08.2011|08:47|0806424172468|06
    CITY HOSPITAL|04680072124|CITY|00614860|18460662462|JR|TEPE|404622|44,16|22.04.2011|20:08|0806446446866|06
    CITY HOSPITAL|04680072124|CITY|00614840|47207688618|BARRY|HRAN|402886|42,40|27.08.2011|11:12|0806478768007|06
    CITY HOSPITAL|04680072124|CITY|00614847|42161048612|TOM|HIGGS|148640|12,00|06.06.2011|08:18|0806068076700|06
    CITY HOSPITAL|04680072124|CITY|00614846|42161048612|TOM|HIGGS|208847|12,00|06.06.2011|08:46|0806068076700|06-----
    NLS_DATE_FORMAT : DD/MM/RRRR-----
    NOTE:
    I tried :
    TARIH CHAR date_format DATE mask "DD/MM/RRRR" , same error.
    Edited by: 904386 on Jan 24, 2012 6:42 AM

    I have no experience with external tables but my understanding is that they are described the same was as you would describe a file to be loaded by SQL Loader. When ever I create a sql loader control file to load a date column I use syntax like this:
    DATE_M                                             "TO_DATE(:DATE_M,'dd.mm.yyyy')",Not sure if that will work for external tables or not.

  • External Table LKM: error during task interpretation

    I've had this problem more than once now, using "LKM File to Oracle (EXTERNAL TABLE)". Before the interface can even run, I get an error, as if the script can't be output. I've tried removing the LKM and reimporting. No use. I am using this LKM successfully in other projects... not sure why it would have issues here. When I had this problem previously, Oracle Support couldn't reproduce it (they certainly tried). I managed to work around it then, but now... this is getting problematic. Insight welcome.
    Here's the start of the error:
    com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Error during task interpretation
    Task:6
    java.lang.Exception: BeanShell script error: Sourced file: inline evaluation of: ``out.print("The application script threw an exception: java.lang.StringIndexOutOf . . . '' Token Parsing Error: Lexical error at line 2, column 42. Encountered: "\\" (92), after : "": <at unknown location>
    BSF info: Create external table at line: 0 column: columnNo
         at com.sunopsis.dwg.codeinterpretor.a.a(a.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Text:The application script threw an exception: java.lang.StringIndexOutOfBoundsException: *String index out of range: 2* BSF info: Create external table at line: 0 column: columnNo

    Hi,
    I have this exact problem, did you get a solution?
    Thanks

  • External table and error: ORA-01036: illegal variable name/number

    using the following script I get the referenced error:
    create table dol_sch_c_part2
    (DLN NUMBER(14) ,
    PAGE_ID VARCHAR2(20),
    PAGE_SEQ VARCHAR2(20),
    PAGE_ROW_NUM VARCHAR2(20),
    ROW_NUM VARCHAR2(20),
    IMAGE_FORM_ID VARCHAR2(20),
    PROVIDER_TERM_01_NAME VARCHAR2(35),
    PROVIDER_TERM_01_EIN VARCHAR2(9) ,
    PROVIDER_TERM_01_POSITION VARCHAR2(25),
    PROVIDER_TERM_01_STR_ADDRESS VARCHAR2(35),
    PROVIDER_TERM_01_CITY VARCHAR2(20),
    PROVIDER_TERM_01_STATE VARCHAR2(2),
    PROVIDER_TERM_01_ZIP_CODE VARCHAR2(9),
    PROVIDER_TERM_01_PHONE_NUM VARCHAR2(10),
    PROVIDER_TERM_01_TEXT VARCHAR2(250)
    ORGANIZATION EXTERNAL
    ( type oracle_loader
    default directory data_dir
    access parameters
    RECORDS FIXED 510
    FIELDS
    DLN(1:14) char(14),
    PAGE_ID(15:34) char(20) NULLIF PAGE_ID=BLANKS,
    PAGE_SEQ(35:54) char(20) NULLIF PAGE_SEQ=BLANKS,
    PAGE_ROW_NUM(55:74) char(20) NULLIF PAGE_ROW_NUM=BLANKS,
    ROW_NUM(75:94) char(20) NULLIF ROW_NUM=BLANKS,
    IMAGE_FORM_ID(95:114) char(20) NULLIF IMAGE_FORM_ID=BLANKS,
    PROVIDER_TERM_01_NAME(115:149) char(35) NULLIF PROVIDER_TERM_01_NAME=BLANKS,
    PROVIDER_TERM_01_EIN(150:158) char(9) NULLIF PROVIDER_TERM_01_EIN=BLANKS,
    PROVIDER_TERM_01_POSITION(159:183) char(25) NULLIF PROVIDER_TERM_01_POSITION=BLANKS,
    PROVIDER_TERM_01_STR_ADDRESS(184:218) char(35) NULLIF PROVIDER_TERM_01_STR_ADDRESS=BLANKS,
    PROVIDER_TERM_01_CITY(219:238) char(20) NULLIF PROVIDER_TERM_01_CITY=BLANKS,
    PROVIDER_TERM_01_STATE(239:240) char(2) NULLIF PROVIDER_TERM_01_STATE=BLANKS,
    PROVIDER_TERM_01_ZIP_CODE(241:249) char(9) NULLIF PROVIDER_TERM_01_ZIP_CODE=BLANKS,
    PROVIDER_TERM_01_PHONE_NUM(250:259) char(10) NULLIF PROVIDER_TERM_01_PHONE_NUM=BLANKS,
    PROVIDER_TERM_01_TEXT(260:509) char(250) NULLIF PROVIDER_TERM_01_TEXT=BLANKS
    location ('f_dol_sch_c_part2.txt')
    I've tried it with and without the char(*) in the fields section - no change
    thanks

    *** SCRIPT START : Session:GLEN_SELF@RAMBO(8) 8/31/2006 12:16:48 PM ***
    Processing ...
    create or replace directory data_dir as 'c:\dol\'
    create table dol_sch_c_part2
    (DLN NUMBER(14) ,
    PAGE_ID VARCHAR2(20),
    PAGE_SEQ VARCHAR2(20),
    PAGE_ROW_NUM VARCHAR2(20),
    ROW_NUM VARCHAR2(20),
    IMAGE_FORM_ID VARCHAR2(20),
    PROVIDER_TERM_01_NAME VARCHAR2(35),
    PROVIDER_TERM_01_EIN VARCHAR2(9),
    PROVIDER_TERM_01_POSITION VARCHAR2(25),
    PROVIDER_TERM_01_STR_ADDRESS VARCHAR2(35),
    PROVIDER_TERM_01_CITY VARCHAR2(20),
    PROVIDER_TERM_01_STATE VARCHAR2(2),
    PROVIDER_TERM_01_ZIP_CODE VARCHAR2(9),
    PROVIDER_TERM_01_PHONE_NUM VARCHAR2(10),
    PROVIDER_TERM_01_TEXT VARCHAR2(250)
    ORGANIZATION EXTERNAL
    ( type oracle_loader
    default directory data_dir
    logfile 'ext_tab.log'
    access parameters
    RECORDS FIXED 510
    FIELDS
    DLN(1:14),
    PAGE_ID(15:34),
    PAGE_SEQ(35:54),
    PAGE_ROW_NUM(55:74),
    ROW_NUM(75:94),
    IMAGE_FORM_ID(95:114),
    PROVIDER_TERM_01_NAME(115:149),
    PROVIDER_TERM_01_EIN(150:158),
    PROVIDER_TERM_01_POSITION(159:183),
    PROVIDER_TERM_01_STR_ADDRESS(184:218),
    PROVIDER_TERM_01_CITY(219:238),
    PROVIDER_TERM_01_STATE(239:240),
    PROVIDER_TERM_01_ZIP_CODE(241:249),
    PROVIDER_TERM_01_PHONE_NUM(250:259),
    PROVIDER_TERM_01_TEXT(260:509)
    location ('f_dol_sch_c_part2.txt')
    create or replace directory data_dir as 'c:\dol\'
    ORA-01036: illegal variable name/number
    *** Script stopped due to error ***
    *** SCRIPT END : Session:GLEN_SELF@RAMBO(8) 8/31/2006 12:16:49 PM ***

  • SQL Server 2k - Pulling from 2 fact tables causes error

    Trying to create a simple RPD as follows:
    1 Dimension with Key Fund_ID
    2 Fact tables, each with a Key Fund_ID
    Created a Physical Layer, connecting Dimension to each Facts based off Fund_ID (One to Many)
    Business Model Layer, connected Dimension to each Fact using complex join.
    In Answers, the following is true:
    Querying Dim and Fact Table A returns Data
    Querying Dim and Fact Table B returns Data
    Querying Dim AND Fact Table A, AND Fact Table B returns the following error message:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table A) does not contain mapping for [table B]. (HY000)
    It appears to be complaining that it cannot map the fact tables to each other. I tried mapping the two fact tables together (even though that doesn't make DW sense), and the RPD won't validate.
    I'm wondering if this is a bug connecting to SQL Server. We do the majority of our RPD development against ORACLE, and this is our first attempt at using SQL Server as a source.
    Does anyone have any suggestions on this?
    thanks

    I doubt it very much its DB specific, the error is from the BI Server ([nQSError: 15018]) rather than SS.
    Have you got a dimension hierarchy ? Are your content levels set for all logical tables, do you have 2 logical facts or 1 combined logical fact ? What do your Logical Table sources look like (ie how many per logical table, conent levels ?joins within the LTS?)
    I would guess the problem lies in your BMM layer. But should check, is the conformed dimension joined to both fact tables in the physical layer or have your aliased it ?

  • Discoverer - Condition on linked table causes error

    When I apply a condition (Cust_ID = 'P6872') on a linked table all of the records are returned...however, some of the data from the linked table is blank.The condition appears to work but not on all of the records. Any ideas why this might happen?
    Thanks for taking the time to read this....
    Message was edited by:
    MichaelB

    The best soultion would probably be to create a database function and register it through Discoverer Administration edition. You can then call the funciton in your condition, to replace the need for a sub-query

  • How to query an external table?

    hi,
    Can anyone help me, I created an external table but I cannot query the table... I encountered the error SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout...
    Attached my SQL for your reference:
    CREATE OR REPLACE DIRECTORY dat_dir AS 'pos_file';
    CREATE OR REPLACE DIRECTORY log_dir AS '//10.101.21.175/pos_file/Log';
    CREATE OR REPLACE DIRECTORY bad_dir AS '//10.101.21.175/pos_file/Bad';
    CREATE TABLE revext (person VARCHAR2(20),
    rev_jan NUMBER(4),
    rev_feb NUMBER(4),
    rev_mar NUMBER(4),
    rev_apr NUMBER(4),
    rev_mai NUMBER(4),
    rev_jun NUMBER(4),
    rev_jul NUMBER(4),
    rev_aug NUMBER(4),
    rev_sep NUMBER(4),
    rev_oct NUMBER(4),
    rev_nov NUMBER(4),
    rev_dez NUMBER(4))
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY dat_dir
    ACCESS PARAMETERS
    records delimited by newline
    fields terminated by ','
    ( person,
    rev_jan,
    rev_feb,
    rev_mar,
    rev_apr,
    rev_mai,
    rev_jun,
    rev_jul,
    rev_aug,
    rev_sep,
    rev_oct,
    rev_nov,
    rev_dez
    LOCATION ('revext.dat')
    Thank you,
    Dexter

    Hi! Thanks for your immediate response...
    Here's the complete error when I tried to query the created external table.
    Error starting at line 48 in command:
    select * FROM revext
    Error report:
    SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    error opening file pos_file/REVEXT_18225.log
    29913. 00000 - "error in executing %s callout"
    *Cause:    The execution of the specified callout caused an error.
    *Action:   Examine the error messages take appropriate action.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • External table filenames

    I am loading hundreds/thousands of files of delimited data via external tables. The record counts for verifying the data is being provided on a file by file level from the mainframe system sending the data, example file prn00532.dat has 78,322 records.
    I can add all the files to the create external table DDL no problem, but I then can not verify that each file that is loaded has the correct number of records as the files all get loaded as a group.
    My question is, without having to create an table for each external file, is there a way to have a calculated column that oracle adds, or a bind or something I can reference to insert into a another table/same table that shows the external data file that oracle is currently loading?
    Basically when oracle switches from file prn00532.dat to prn00533.dat I can capture that...

    Instead of disturbing parallel coordinators you could just submit n jobs each doing a simple <b>insert into big_table select * from external_table_n</b> or something similar - all external_tables_i having the same structure just different location parameters.
    Regards
    Etbin
    Edited by: Etbin on 26.2.2011 12:25
    possibly grouping text data files according to partitions the data would end within

  • Mounting external tables - ORA-03113 caused when trying to select from

    We're having trouble trying to select from a mounted external table on Oracle 9.2.0.1.0. Each time a procedure containing the simple select statment is executed (within sqlplus) it causes the following error:
    ORA-03113: end-of-file on communication channel
    Initially we thought it was because we were using sqlplus 8.1.7 but when switching to 9.2.0 the error still occurs. We can do a desc and select count(*) on it though.
    Is this a know bug? Is there a work around?
    Jo

    We're having trouble trying to select from a mounted external table on Oracle 9.2.0.1.0. Each time a procedure containing the simple select statment is executed (within sqlplus) it causes the following error:
    ORA-03113: end-of-file on communication channel
    Initially we thought it was because we were using sqlplus 8.1.7 but when switching to 9.2.0 the error still occurs. We can do a desc and select count(*) on it though.
    Is this a know bug? Is there a work around?
    Jo

  • Mounting external tables - ORA-03113 caused when trying to select

    We're having trouble trying to select from a mounted external table on Oracle 9.2.0.1.0. Each time a procedure containing a simple select statement is executed (within sqlplus) it causes the following error:
    ORA-03113: end-of-file on communication channel
    Initially we thought it was because we were using sqlplus 8.1.7 but when switching to 9.2.0 the error still occurs. We can do a desc and select count(*) on it though.
    Is this a know bug? Is there a work around?
    Jo

    We're having trouble trying to select from a mounted external table on Oracle 9.2.0.1.0. Each time a procedure containing a simple select statement is executed (within sqlplus) it causes the following error:
    ORA-03113: end-of-file on communication channel
    Initially we thought it was because we were using sqlplus 8.1.7 but when switching to 9.2.0 the error still occurs. We can do a desc and select count(*) on it though.
    Is this a know bug? Is there a work around?
    Jo

  • Error while creating external table

    Hi i tried to create external table. The table is created but while selecting that table it is throwing below errors
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file Countries1.txt in EXT_TABLES not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19I've created temp directory in window under oracle directory " C:\oracle\product\10.2.0\temp"
    In the temp directory i've a text file countries1.txt
    the text file has the below information
    ENG,England,English
    SCO,Scotland,English
    IRE,Ireland,English
    WAL,Wales,WelshI've connected to system user and created one directory and granted the read and write permissions to user SCOTT.
    SQL> create or replace directory ext_tables as 'C:\oracle\product\10.2.0\temp\';
    Directory created.
    SQL> grant read,write on directory ext_tables to scott;
    Grant succeeded.The creation of external table query is
    CREATE TABLE countries_ext (
      country_code      VARCHAR2(5),
      country_name      VARCHAR2(50),
      country_language  VARCHAR2(50)
    ORGANIZATION EXTERNAL (
      TYPE ORACLE_LOADER
      DEFAULT DIRECTORY ext_tables
      ACCESS PARAMETERS (
        RECORDS DELIMITED BY NEWLINE
        FIELDS TERMINATED BY ','
        MISSING FIELD VALUES ARE NULL
          country_code      CHAR(5),
          country_name      CHAR(50),
          country_language  CHAR(50)
      LOCATION ('Countries1.txt')
    PARALLEL 5
    REJECT LIMIT UNLIMITED;And the error is
    SQL> select *from countries_ext;
    select *from countries_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file Countries1.txt in EXT_TABLES not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    SQL> Please help me in this

    You are missing something. Most probably the file does not exists in your specified path. This is working in my 10.2.0.3
    Step1: Check the file is actually there.
    C:\oracle\product\10.2.0>mkdir temp
    C:\oracle\product\10.2.0>cd temp
    C:\oracle\product\10.2.0\temp>dir
    Volume in drive C is C_Drive
    Volume Serial Number is 8A93-1441
    Directory of C:\oracle\product\10.2.0\temp
    07/30/2011  12:00 PM    <DIR>          .
    07/30/2011  12:00 PM    <DIR>          ..
    07/30/2011  12:00 PM                79 countries1.txt
                   1 File(s)             79 bytes
                   2 Dir(s)  50,110,582,784 bytes free
    C:\oracle\product\10.2.0\temp>type countries1.txt
    ENG,England,English
    SCO,Scotland,English
    IRE,Ireland,English
    WAL,Wales,Welsh
    C:\oracle\product\10.2.0\temp>Step 2: Creating the directory object.
    SQL> show user
    USER is "SYS"
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> create or replace directory ext_tables as 'C:\oracle\product\10.2.0\temp';
    Directory created.
    SQL> grant read,write on directory ext_tables to scott;
    Grant succeeded.
    SQL>Step 3: Table definition.
    C:\>sqlplus scott@orclsb/tiger
    SQL*Plus: Release 10.1.0.4.2 - Production on Sat Jul 30 12:04:24 2011
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> CREATE TABLE countries_ext (
      2    country_code      VARCHAR2(5),
      3    country_name      VARCHAR2(50),
      4    country_language  VARCHAR2(50)
      5  )
      6  ORGANIZATION EXTERNAL (
      7    TYPE ORACLE_LOADER
      8    DEFAULT DIRECTORY ext_tables
      9    ACCESS PARAMETERS (
    10      RECORDS DELIMITED BY NEWLINE
    11      FIELDS TERMINATED BY ','
    12      MISSING FIELD VALUES ARE NULL
    13      (
    14        country_code      CHAR(5),
    15        country_name      CHAR(50),
    16        country_language  CHAR(50)
    17      )
    18    )
    19    LOCATION ('Countries1.txt')
    20  )
    21  PARALLEL 5
    22  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> SELECT * FROM countries_ext;
    COUNT COUNTRY_NAME
    COUNTRY_LANGUAGE
    ENG   England
    English
    SCO   Scotland
    English
    IRE   Ireland
    English
    COUNT COUNTRY_NAME
    COUNTRY_LANGUAGE
    WAL   Wales
    Welsh

  • 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 --

  • Error in creating an external table referring to a XML file

    I've got an XML file and I've tried to create an external table referring to it in this way:
    CREATE TABLE mytable
        XML_DATA_COLUMN XMLType
      ORGANIZATION EXTERNAL
        TYPE ORACLE_LOADER DEFAULT DIRECTORY TEST_DIR
        ACCESS PARAMETERS ( records delimited BY newline
        (XML_DATA_COLUMN LOB) ) LOCATION ( 'myfile.xml' )
    where TEST_DIR is the directory where myfile.xml is stored,
    but I get this message:
    Error at Command Line:3 Column:4
    Error report:
    SQL Error: ORA-30656: column type not supported on external organized table
    30656.0000 -  "column type not supported on external organized table"
    *Cause:    Attempt to create an external organized table with a column
               of type LONG, LOB, BFILE, ADT, or VARRAY.
    *Action:   These column types are not supported, change the DDL.
    I want to have in the XML_DATA_COLUMN the content of myfile.xml so as to handle it by using extract and extractvalue functions.
    My oracle version is 10gR2 Express Edition
    Thanks!

    The examples in the following thread include an insert, but you could also use the select statement alone without the insert.
    http://www.orafaq.com/forum/mv/msg/172162/511897/0/#msg_511897

Maybe you are looking for