Create an external Table - KUP-04020

11.2.0.1.0 64-bit

...  ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
     DEFAULT DIRECTORY ext_tab_dir
     ACCESS PARAMETERS
       (RECORDS DELIMITED BY NEWLINE
          FIELDS TERMINATED BY ',' ENCLOSED BY '"'
          (... {code}


{code}ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04020: found record longer than buffer size supported, 524288, in c:\ext_tables\nff.csv{code}

When opening up the data for examination, the records are delimited with LF, and not CRLF.  
Would this be picked up with delimiter NEWLINE, or should I use something else?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

To resolve this problem, change the delimiter CHARACTERSET and reviews

ex:
saves the delimiter character > record delimiter '\n '.

Add in the parameters of access CHARACTERSET 'utf8 '.

Tags: Database

Similar Questions

  • create an external table based on local drive

    Hello world

    Is it possible to create an external table and that it points to a file on my local drive?

    It is perhaps a silly question. I'm sorry.

    Thank you

    Lydiea

    In addition to the response of William Robertson (which is correct), if you do not have a way to make the server access to your local disk, you can use sql loader on your local computer to load the data into an actual table.

  • Creating the external Table - length fixed

    I was responsible for importing data in fixed length of a text file in an oracle table. To do this, I create an external Table. I'm finally at the point where the script works to create the table, but when I run a statement select for ' select * from external table ', I have received only a single line/record (the first line of the text file).

    This is what the script looks like:
    CREATE TABLE EXT_MD
    (
    AR_SID VARCHAR2 (12),
    AR_SSN VARCHAR2 (4).
    AR_LASTNAME VARCHAR2 (29),
    AR_FIRSTNAME VARCHAR2 (27),
    AR_RACE VARCHAR2 (1).
    DATE OF AR_DOB,
    NA_LASTNAME VARCHAR2 (29),
    NA_FIRSTNAME VARCHAR2 (27),
    NA_SEX VARCHAR2 (1).
    ID_FBI_ID VARCHAR2 (9).
    AR_ARR_DATE VARCHAR (26).
    AR_PRIMARY_CHARGE VARCHAR2 (35),
    DEM_STREET_NBR VARCHAR2 (5).
    DEM_STREET_NAM VARCHAR2 (10),
    DEM_STREET_SFX VARCHAR2 (2),
    DEM_STREET_DIR VARCHAR2 (2),
    DEM_CITY VARCHAR2 (10),
    DEM_STATE VARCHAR2 (2),
    DEM_ZIP VARCHAR2 (5).
    AR_TRACK_NUM VARCHAR2 (12),
    DEM_ORI VARCHAR2 (9)
    )
    EXTERNAL ORGANIZATION
    (TYPE ORACLE_LOADER
    THE DEFAULT DIRECTORY EXT_DIR
    ACCESS SETTINGS
    (
    RECORDS DELIMITED BY NEWLINE
    BADFILE EXT_DIR: 'ext_bag.bad'
    EXT_DIR LOG file: 'ext_good.log'
    FIELDS
    MISSING FIELD VALUES ARE NULL
    (
    AR_SID(1:12) CHAR (12),
    AR_SSN(13:16) CHAR (4),
    AR_LASTNAME(17:45) TANK (29),
    AR_FIRSTNAME(46:72) TANK (27),
    AR_RACE(73:73) CHAR (1),
    AR_DOB(74:83) CHAR(10) DATE_FORMAT DATE MASK "YYYY-MM-DD"
    NA_LASTNAME(84:112) TANK (29),
    NA_FIRSTNAME(113:139) TANK (27),
    NA_SEX(140:140) CHAR (1),
    ID_FBI_ID(141:149) CHAR(9),
    AR_ARR_DATE(150:175) TANK (26),
    AR_PRIMARY_CHARGE(176:210) CHAR (35),
    DEM_STREET_NBR(211:215) CHAR (5),
    DEM_STREET_NAM(216:225) CHAR(10),
    DEM_STREET_SFX(226:227) CHAR (2),
    DEM_STREET_DIR(228:229) CHAR (2),
    DEM_CITY(230:239) CHAR(10),
    DEM_STATE(240:241) CHAR (2),
    DEM_ZIP(242:246) CHAR (5),
    AR_TRACK_NUM(247:258) CHAR (12),
    DEM_ORI(259:267) TANK (9)
    )
    )
    LOCATION ("daily.txt")
    )
    REJECT LIMIT UNLIMITED;

    That's what part of the log file looks like:

    For table EXT_MD field definitions
    Record format DELIMITED BY newline
    Data in file have same "endianness" as platform
    Rows with all null fields are accepted

    Fields of the Data Source:

    AR_SID TANK (12)
    Position of the record (1: 12)
    Cut the whites of right
    AR_SSN CHAR (4)
    Position of the record (13: 16)
    Cut the whites of right
    etc (shows the rest of the columns with similar message) then at the end of the log file

    Transformations of columns
    ROWID

    Date table EXT_MD Cache statistics
    Maximum size: 1000
    Entries: 1
    Hits: 0
    Rate: 0

    Assistance or management will most certainly be appreciated. Thanks in advance.

    Published by: zephyr223 on March 25, 2013 10:47

    Hello
    Which characters do you have in your data file that define the "line break".

    Oracle documentation:

    If DELIMITED BY NEWLINE is specified, then the actual value used is platform-specific. On UNIX platforms, NEWLINE is assumed to be "\n". On Windows NT, NEWLINE is assumed to be "\r\n".
    

    you have these 'hidden' characters in your folder or are they something else?

    Kind regards
    Harry

  • Creating the external Table to alert log

    Hello

    I create an external table in oracle database 11g for the alert log file monitoring (to find the ORA errors), I used this statement to create an external table

    Create the directory TESTForAlertLog as 'E:\oracle\product\10.2.0\admin\db\bdump '.

    create table Alert_Log)
    Message varchar2 (30),
    Date of the day
    )
    (external) Organization
    type oracle_loader
    Default directory TESTForAlertLog
    (settings) access
    records delimited by newline
    fields ended by ',' possibly framed by "" "
    missing field values are null
    (
    "Message."
    'DAY' DATE 'DD MM YYYY ".
    )
    )
    location ("alert_db.log")
    )
    reject limit unlimited;

    Output is

    DAY OF MSG

    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORA-1109 marked during: ALTER DATABASE CLOSE NORMAL...
    ORA-00313: open failed for the members of the group log 1 of thread 1
    ORA-00312: thread 1 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO01. JOURNAL"
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of the Group of newspapers wire 2 1
    ORA-00312: wire 2 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO02. JOURNAL"
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of Group 3, Journal of thread 1
    ORA-00312: wire 3 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO03. JOURNAL"
    ORA-27041: could not open the file
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0

    But I need the eyes of output like this


    DAY OF MSG

    ORACLE V10.2.0.1.0 - Production vsnsta = 0 lun 22 dec 13:10:48 2008
    ORACLE V10.2.0.1.0 - Production vsnsta = 0 lun 22 dec 13:10:48 2008
    ORA-1109 marked during: ALTER DATABASE CLOSE NORMAL...
    ORA-00313: open failed for the members of the group log 1 of thread 1
    ORA-00312: thread 1 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO01. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of the Group of newspapers wire 2 1
    ORA-00312: wire 2 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO02. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of Group 3, Journal of thread 1
    ORA-00312: wire 3 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO03. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0

    I need the message and time of the message occurred

    No idea... is it possible to get this output...


    Thank U very much

    Concerning

    SHAN

    Read this - he explains how:
    http://www.singleQuery.com/2007/02/read-the-alert-log-with-SQL/

  • Create an external table to import csv to dynamic action

    Hello

    I'm trying to import data from a csv file into a table. The csv is located on the server and I try to do an external table to copy its contents to the master data table.
    I can't even save the code, without this error:
    PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
    ( begin case declare exit for goto if loop mod null pragma raise return select update
    while with <an identifier> <a double-quoted delimited-identifier> <a bind variable>
    << continue close current delete fetch lock insert open rollback savepoint set sql execute
    commit forall merge pipe purge
    It works very well in the SQL Developer.
    CREATE TABLE  "DATA_CSV" 
       (     "C1" VARCHAR2(255), 
         "C2" VARCHAR2(255), 
         "C3" VARCHAR2(255), 
         "C4" VARCHAR2(255), 
         "C5" VARCHAR2(255), 
         "C6" VARCHAR2(255), 
         "C7" VARCHAR2(255), 
         "C8" VARCHAR2(255), 
         "C9" VARCHAR2(255), 
         "C10" VARCHAR2(255), 
         "C11" VARCHAR2(255), 
         "C12" VARCHAR2(255), 
         "C13" VARCHAR2(255), 
         "C14" VARCHAR2(255), 
         "C15" VARCHAR2(255), 
         "C16" VARCHAR2(255), 
         "C17" VARCHAR2(255), 
         "C18" VARCHAR2(255), 
         "C19" VARCHAR2(255), 
         "C20" VARCHAR2(255)
       )
        ORGANIZATION EXTERNAL
        (
          TYPE ORACLE_LOADER
          DEFAULT DIRECTORY FTP_FOLDER
          ACCESS PARAMETERS (
            records delimited BY newline
            fields terminated BY ';'
            optionally enclosed BY '"'
            lrtrim
            missing field VALUES are NULL
          )
        LOCATION ('foo.csv')
        );
    {code}
    
    The server I work on, runs on Apex 4.2.2.
    
    Thanks in advance, for your help
    Skirnir                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

  • Create an external table fails

    I'm trying to map a trace file in an external table ' but I get the error message "missing the key word."
    set verify off
    
    create or replace directory 'TRACE_DIR' as '/db_home/oracle/product/diag/rdbms/test/dtms_t/trace';
    
    column id new_value os_user;
    SELECT sys_context('USERENV', 'OS_USER') id FROM DUAL;
    
    BEGIN
          EXECUTE IMMEDIATE 'alter session set tracefile_identifier = &os_user' ; 
    END;
    /
    
    column tracefile_loc new_value tracefile
    select SUBSTR(tracefile_loc,INSTR(tracefile_loc,'/',-1)+1) tracefile_loc
    from
     ( select value ||'/'||(select instance_name from v$instance) ||'_ora_'||
                  (select spid||case when traceid is not null then '_'||traceid else null end
                        from v$process where addr = (select paddr from v$session
                                                     where sid = (select sid from v$mystat
                                                                  where rownum = 1
                                                                 )
                                                    )
                  ) || '.trc' tracefile_loc
       from v$parameter where name = 'user_dump_dest'
     )
    /
    
    jbrock@ddtms_t> CREATE TABLE trace_ext
      2                     (line varchar2(80)
      3                     )
      4       ORGANIZATION EXTERNAL
      5       (
      6         TYPE ORACLE_LOADER
      7         DEFAULT DIRECTORY trace_dir
      8         ACCESS PARAMETERS
      9         (
     10           records delimited by newline
     11           missing field values are null
     12           ( line
     13           )
     14         )
     15         LOCATION (&&tracefile)
     16       )
     17       REJECT LIMIT UNLIMITED;
           LOCATION (ddtms_t_ora_9101_JBROCK.trc)
                                                *
         
    ERROR at line 15:
    ORA-00905: missing keyword

    Hello

    JimmyB wrote:

    ... jbrock@ddtms_t> CREATE TABLE trace_ext
    2                     (line varchar2(80)
    3                     )
    4       ORGANIZATION EXTERNAL
    5       (
    6         TYPE ORACLE_LOADER
    7         DEFAULT DIRECTORY trace_dir
    8         ACCESS PARAMETERS
    9         (
    10           records delimited by newline
    11           missing field values are null
    12           ( line
    13           )
    14         )
    15         LOCATION (&&tracefile)
    16       )
    17       REJECT LIMIT UNLIMITED;
    LOCATION (ddtms_t_ora_9101_JBROCK.trc)
    *
    
    ERROR at line 15:
    ORA-00905: missing keyword
    

    The location must not be single-quotes? For line 15, try

    LOCATION ('&&tracefile')
    
  • Helps to create an external table to a dashboard

    I am creating a table in an external file that will receive and organize partitions from Quiz.fla when you click on the button to submit the results.  I also want another fla file to reference the external table and pull 15 scores him and then view scores on a scrolling banner.  I want the banner to be able update dynamically (I guess it would accomplish the reloading of the banner fla every time it reaches the end of its cycle, with the first load of the image of the outer table on an onClipEvent action), how it will update while remaining open.  The main reason that I need two separate files for the quiz and the banner of the score is that they are displayed on two different monitors.  What would be the most effective way to solve this problem?  I know a little actionscript, but I don't have much experience with the call for data and functions from external fla or as files (table and function referring to the way in which the data will be organized inside the table will be in a file separate .as).

    I currently work in AS2, since I had almost no experience with AS3.

    Please mark this thread as answered, if it is closed.

  • Creating an external Table using Xml Dataset - how to include null values?

    The script below works fine, but I'm fails as soon as the xml file does not contain a column for a line, or has the value as "< ACTUAL_FLAG / >.

    Is there way I can show the missing values as null?

    With the help of "missing field is null values" does not work for me.

    Any help would be appreciated.


    < < < < < < < < < <
    / * Formatting on the 2010-05-24 14:53:01 (v5.136.908.31019 PS5) * /.
    DROP TABLE ENE_GL_SAP_TEMP;

    CREATE TABLE ENE_GL_SAP_TEMP
    (
    status VARCHAR2 (50).
    number of ledger_id (15),
    set_of_books_id NUMBER (15),
    accounting_date DATE,
    CURRENCY_CODE VARCHAR2 (15).
    Date_Created DATE,
    created_by NUMBER (15),
    actual_flag VARCHAR2 (1).
    user_je_category_name VARCHAR2 (25).
    user_je_source_name VARCHAR2 (25).
    Segment1 VARCHAR2 (25).
    Segment2 VARCHAR2 (25).
    segment3 VARCHAR2 (25).
    segment4 VARCHAR2 (25).
    segment5 VARCHAR2 (25).
    segment6 VARCHAR2 (25).
    segment7 VARCHAR2 (25).
    entered_dr NUMBER,
    entered_cr NUMBER,
    accounted_dr NUMBER,
    accounted_cr NUMBER,
    Reference1 VARCHAR2 (100)
    )
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_LOADER
    THE DEFAULT DIRECTORY ENE_SOLAR_FTP_IN_DIR
    ACCESS SETTINGS
    (
    records delimited by ' < / GL_REC >.
    BadFile "temp.bad."
    logfile "temp.log.
    fields)

    filler TANK (2000) TERMINATED BY "< GL_REC >,"
    status (50) tank surrounded by '<>STATUS' and ' < / STATUS >. "
    ledger_id char (15), framed by '< LEDGER_ID >' and ' < / LEDGER_ID >, "
    set_of_books_id char (15), framed by '< SET_OF_BOOKS_ID >' and ' < / SET_OF_BOOKS_ID >, "
    accounting_date char (11), framed by '< ACCOUNTING_DATE >' and ' < / ACCOUNTING_DATE >, "
    Char (15) currency_code framed by '< CURRENCY_CODE >' and ' < / CURRENCY_CODE >. "
    tank (11) Date_Created framed by '< DATE_CREATED >' and ' < / DATE_CREATED > "date_format DATE mask MON/dd/yyyy". "
    created_by char (12), framed by '< CREATED_BY >' and ' < / CREATED_BY >. "
    actual_flag char (1) surrounded by '< ACTUAL_FLAG >' and ' < / ACTUAL_FLAG >, "
    user_je_category_name tank (25), framed by '< USER_JE_CATEGORY_NAME >' and ' < / USER_JE_CATEGORY_NAME >, "
    user_je_source_name tank (25), framed by '< USER_JE_SOURCE_NAME >' and ' < / USER_JE_SOURCE_NAME >, "
    tank (25) Segment1 framed by '< SEGMENT1 >' and ' < / SEGMENT1 >. "
    tank (25) Segment2 framed by '< SEGMENT2 >' and ' < / SEGMENT2 >. "
    tank (25) segment3 framed by '< SEGMENT3 >' and ' < / SEGMENT3 >. "
    segment4 tank (25), framed by '< SEGMENT4 >' and ' < / SEGMENT4 >, "
    tank (25) segment5 framed by '< SEGMENT5 >' and ' < / SEGMENT5 >, "
    segment6 tank (25), framed by '< SEGMENT6 >' and ' < / SEGMENT6 >, "
    segment7 tank (25), framed by '< SEGMENT7 >' and ' < / SEGMENT7 >. "
    entered_dr char (15), framed by '< ENTERED_DR >' and ' < / ENTERED_DR >, "
    entered_cr char (15), framed by '< ENTERED_CR >' and ' < / ENTERED_CR >, "
    accounted_dr char (15), framed by '< ACCOUNTED_DR >' and ' < / ACCOUNTED_DR >, "
    accounted_cr char (15), framed by '< ACCOUNTED_CR >' and ' < / ACCOUNTED_CR >, "
    tank (100) of reference1 framed by '< REFERENCE1 >' and ' < / REFERENCE1 >.



    )
    )
    LOCATION ("books2.xml")
    )
    PARALLEL
    REJECT LIMIT UNLIMITED;


    Select * from ENE_GL_SAP_TEMP;

    > > > > > > > > > > > > > > > > > >

    Hello

    It's funny, I never thought of parsing an XML through SQL * Loader before.

    Are you aware of the XML DB features? They are intended only for what you are doing here.

    Also, please look at function XMLTable. It allows you to directly map your XML file in columns and relational rows.

    For example, by giving an example of file "book.xml" like this:

    
    
     
      1
      2
      ABC
      DEF
     
     
      1
      3
      XYZ
      TTT
     
    
    

    Then, just do:

    SELECT *
    FROM XMLTable(
     '/GL_RECS/GL_REC'
     passing xmltype( bfilename('XML_DIR','book.xml'), nls_charset_id('CHAR_CS') )
     columns
      status varchar2(50) path 'STATUS',
      ledger_id varchar2(15) path 'LEDGER_ID',
      segment1 varchar2(25) path 'SEGMENT1',
      segment2 varchar2(25) path 'SEGMENT2'
    );
    
  • creating an external table

    Hello

    I made an excel csv file, but some of the columns of the excel file are null, so I did type .dat
    and when I try: select *.
    from caen:

    I get this error:

    Error at startup on line 2 of the command:
    Select *.
    Caen
    Error report:
    SQL error: ORA-29913: error in executing ODCIEXTTABLEFETCH legend
    ORA-30653: reject limit reached
    29913 00000 - "error in the execution of %s legend".
    * Cause: The execution of the specified legend caused an error.
    * Action: Examine the error messages take appropriate measures.

    I also have a comma after each line FRO this .dat file.
    Can you help me to import this file?

    Thank you

    Some of your data values seem to have a comma in the data:

    Cultivarea cerealelor (exclusiv orez), plantelor leguminoase si aplantelor producatoare de seminte oleaginoase
    Cultivarea legumelor si a pepenilor, a radacinoaselor si tuberculilor
    Cultivarea fructelor arbustilor fructiferi, capsunilor, nuciferilorsi a altor pomi fructiferi
    Cultivarea condimentelor, plantelor aromatice, medicinale si aplantelor de uz farmaceutic
    

    I suggest that you change your data file if you can so that text fields are surrounded with double quotes.

  • Create the external data with dates table

    I have a CSV file that looks a little like this:

    abcuser,12345,5/12/2012,5,250.55
    xyzuser, 67890, 5/1/2012,1,50
    ghjuser, 52523, 1 January 00

    When I create the external table, then question him, I get an error of date:

    CREATE TABLE xtern_ipay
    (
    username VARCHAR2 (50).
    acctNbr NUMBER 20 (0)
    datelastused DATE,
    number_rtxns NUMBER (12: 0).
    amtused NUMBER (12: 0)
    )
    external organization (TYPE oracle_loader DEFAULT directory "XTERN_DATA_DIR"
    (Settings) ACCESS
    records delimited BY newline completed fields BY ',')
    release location ("SubscriberStatistics.csv") limit) UNLIMITED;

    The error I see in the newspaper of rejection:
    For table XTERN_IPAY field definitions
    Record format DELIMITED BY newline
    Data in file have same "endianness" as platform
    Rows with all null fields are accepted

    Fields of the Data Source:

    USERID CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    ACCTNBR CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    DATELASTUSED CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    NUMBER_RTXNS CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    AMTUSED CHAR (255)
    Completed by «,»
    Trim whitespace same as SQL Loader
    column in treatment of DATELASTUSED error in the row 1 for the g:\externaltables\SubscriberStatistics.csv data file
    ORA-01858: a non-digit character was found here where was waiting for a digital
    column in treatment of DATELASTUSED error in line 2 to the g:\externaltables\SubscriberStatistics.csv data file
    ORA-01858: a non-digit character was found here where was waiting for a digital
    column in treatment of DATELASTUSED error on line 3 for the g:\externaltables\SubscriberStatistics.csv data file
    ORA-01858: a non-digit character was found here where was waiting for a digital


    Any ideas on that? I know I must tell oracle the date on the external file format, but I can't understand it.
  • Creating external Tables using the EXECUTE IMMEDIATE in PL/SQL

    Hi guys,.

    I am trying to create an external Table using the EXECUTE IMMEDIATE in a procedure and I managed to compile and no errors were generated. But when I try to run it from sql using the exec command I get the following error:

    ------------------------------------------------------------------------
    ERROR on line 5:
    ORA-00911: invalid character
    ORA-06512: at "GEO. TEST_DDL', line 4
    ORA-06512: at line 5

    -------------------------------------------------------------------------

    I tried to check the whole statement to create the external table, but I can't find where is the error. Surprisingly, if I simply run the command table create external on sqlplus it works, but not a procedure.

    If anyone can help with ideas or experience?

    Geoffrey Kossami

    The error means that there is an identifier somewhere that starts with a nonalphanumeric. This is a typical mistake of editing. A procedure compiles correctly is not of course because the underlying dynamic sql running is OK. Which of course only be resolved when you try to run it.

    There is certainly a problem with the text you provide to be run as a piece of dynamic sql code. You should try to watch it with dbms_output and run this code in sqlplus. But your problem is with the code you run as dynamic PL/SQL, it is not itself compilable.

    Jack

  • Reg: question of external table-

    Hi Experts,

    I am trying to create and read from an external table, but it raises an error. Please notify.

    Scenario-

    I'm downloading a file of my APEX application that is stored in a BLOB field. Then, comes the following:

    DBMS_LOB.CREATETEMPORARY (v_clob, true);

    -/ / Convert BLOB on the CLOB type

    () DBMS_LOB.converttoclob

    v_clob, v_blob,

    DBMS_LOB. LOBMAXSIZE,

    v_dest_offset, v_src_offset,

    v_blob_csid, v_lang_context, g_msg

    );

    -/ / creating a csv file

    v_temp_filename: = 'apex_ ' | TO_CHAR (sysdate, 'yyyymmddhh24miss') |'. CSV';

    -/ / Put the csv file in the database directory 'APEX_DIR '.

    dbms_xslprocessor.clob2file (v_clob, 'APEX_DIR', v_temp_filename);

    -/ / creating an external table

    v_ext_table: = q'[create table (apex_temp_data_ext)

    C001 varchar2 (4000), c002 varchar2 (4000), c003 varchar2 (4000), c004 varchar2 (4000), c005 varchar2 (4000).

    C006 varchar2 (4000), c007 varchar2 (4000), c008 varchar2 (4000), c009 varchar2 (4000) c010 varchar2 (4000).

    C011 varchar2 (4000), c012 varchar2 (4000), c013 varchar2 (4000), c014 varchar2 (4000), c015 varchar2 (4000).

    C016 varchar2 (4000), c017 varchar2 (4000), c018 varchar2 (4000), c019 varchar2 (4000), c020 varchar2 (4000).

    C021 varchar2 (4000), c022 varchar2 (4000), c023 varchar2 (4000), c024 varchar2 (4000), see c025 varchar2 (4000).

    C026 varchar2 (4000), c027 varchar2 (4000), c028 varchar2 (4000), c029 varchar2 (4000), c030 varchar2 (4000).

    C031 varchar2 (4000), c032 varchar2 (4000), c033 varchar2 (4000), c034 varchar2 (4000), c035 varchar2 (4000).

    c037 varchar2 (4000), c038 varchar2 (4000), c039 varchar2 (4000), C036 varchar2 (4000), c040 varchar2 (4000).

    c042 varchar2 (4000), c043 varchar2 (4000), c044 varchar2 (4000), c041 varchar2 (4000), c045 varchar2 (4000).

    C046 varchar2 (4000), c047 varchar2 (4000), c048 varchar2 (4000), c049 varchar2 (4000), c050 varchar2 (4000)

    )

    (external) Organization

    type oracle_loader

    the default directory apex_dir

    (settings) access

    records delimited by newline

    fields completed by «,»

    surrounded of possibly ' "' and '"' NOTRIM

    missing field values are null

    (

    C001 varchar2 (4000), c002 varchar2 (4000), c003 varchar2 (4000), c004 varchar2 (4000), c005 varchar2 (4000).

    C006 varchar2 (4000), c007 varchar2 (4000), c008 varchar2 (4000), c009 varchar2 (4000) c010 varchar2 (4000).

    C011 varchar2 (4000), c012 varchar2 (4000), c013 varchar2 (4000), c014 varchar2 (4000), c015 varchar2 (4000).

    C016 varchar2 (4000), c017 varchar2 (4000), c018 varchar2 (4000), c019 varchar2 (4000), c020 varchar2 (4000).

    C021 varchar2 (4000), c022 varchar2 (4000), c023 varchar2 (4000), c024 varchar2 (4000), see c025 varchar2 (4000).

    C026 varchar2 (4000), c027 varchar2 (4000), c028 varchar2 (4000), c029 varchar2 (4000), c030 varchar2 (4000).

    C031 varchar2 (4000), c032 varchar2 (4000), c033 varchar2 (4000), c034 varchar2 (4000), c035 varchar2 (4000).

    c037 varchar2 (4000), c038 varchar2 (4000), c039 varchar2 (4000), C036 varchar2 (4000), c040 varchar2 (4000).

    c042 varchar2 (4000), c043 varchar2 (4000), c044 varchar2 (4000), c041 varchar2 (4000), c045 varchar2 (4000).

    C046 varchar2 (4000), c047 varchar2 (4000), c048 varchar2 (4000), c049 varchar2 (4000), c050 varchar2 (4000)

    )

    )

    location ('] ' |) v_temp_filename | " ')

    )

    3 parallel

    reject limit unlimited;] " ;



    immediately run v_ext_table;

    It gives me a generic mistake on the front-end server. But, when I take this external Table as well as the "v_temp_filename", that it is created, but when the SELECTION is fired triggers error:

    ORA-29913: error in executing ODCIEXTTABLEOPEN legend

    ORA-29400: data cartridge error

    KUP-00554: error occurred when parsing the access settings

    KUP-01005: syntax error: found 'distinctive sign': expected an a: "binary_double, types binary_float, comma, date, defaultif, char, decimal, double, float, integer, (, nullif, oracle_date, oracle_number, position, raw, recnum,), unsigned, varchar, varraw, varrawc, varcharc, zoned.

    KUP-01008: the bad ID was: varchar2

    KUP-01007: in column 15 of line 6

    Privilege is already provided - GRANT READ, WRITE on APEX_DIR to APEX_DEV;

    But you should check with DBA on the rwx for the generated 'v_temp_filename' permission.

    Pointers?

    Thank you and best regards,

    Nordine

    (on Oracle 11.2.0.3.0, Apex 4.2.5)

    Try this:

    . . .   E t c...

    -/ / creating an external table

    v_ext_table: = "CREATE TABLE Apex_Temp_Data_Ext

    (

    C001 VARCHAR2 (4000), C002 VARCHAR2 (4000), C003 VARCHAR2 (4000), C004 VARCHAR2 (4000), C005 VARCHAR2 (4000).

    C006 VARCHAR2 (4000), C007 VARCHAR2 (4000), C008 VARCHAR2 (4000), C009 VARCHAR2 (4000), C010 VARCHAR2 (4000).

    C011 VARCHAR2 (4000), C012 VARCHAR2 (4000), C013 VARCHAR2 (4000), C014 VARCHAR2 (4000), C015 VARCHAR2 (4000).

    C016 VARCHAR2 (4000), C017 VARCHAR2 (4000), C018 VARCHAR2 (4000), C019 VARCHAR2 (4000), C020 VARCHAR2 (4000).

    C021 VARCHAR2 (4000), C022 VARCHAR2 (4000), C023 VARCHAR2 (4000), C024 VARCHAR2 (4000), SEE C025 VARCHAR2 (4000).

    C026 VARCHAR2 (4000), C027 VARCHAR2 (4000), C028 VARCHAR2 (4000), C029 VARCHAR2 (4000), C030 VARCHAR2 (4000).

    C031 VARCHAR2 (4000), C032 VARCHAR2 (4000), C033 VARCHAR2 (4000), C034 VARCHAR2 (4000), C035 VARCHAR2 (4000).

    C036 VARCHAR2 (4000), C037 VARCHAR2 (4000), C038 VARCHAR2 (4000), C039 VARCHAR2 (4000), C040 VARCHAR2 (4000).

    C041 VARCHAR2 (4000), C042 VARCHAR2 (4000), C043 VARCHAR2 (4000), C044 VARCHAR2 (4000), C045 VARCHAR2 (4000).

    C046 VARCHAR2 (4000), C047 VARCHAR2 (4000), C048 VARCHAR2 (4000), C049 VARCHAR2 (4000), C050 VARCHAR2 (4000)

    )

    (EXTERNAL) ORGANIZATION

    TYPE Oracle_Loader

    The DEFAULT DIRECTORY Apex_Dir

    (SETTINGS) ACCESS

    RECORDS DELIMITED BY NEWLINE

    FIELDS TERMINATED BY ","

    OPTIONALLY SURROUNDED BY "" "AND" "" NOTRIM

    MISSING FIELD VALUES ARE NULL

    (

    C001 TANK (4000), C002 TANK (4000), C003 TANK (4000), C004 TANK (4000), CHAR C005 (4000),

    C006 TANK (4000), C007 TANK (4000), C008 TANK (4000), C009 TANK (4000), C010 TANK (4000).

    C011 TANK (4000), C012 TANK (4000), C013 TANK (4000), CHAR C014 (4000), C015 TANK (4000),

    C016 TANK (4000), C017 TANK (4000), CHAR C018 (4000), C019 TANK (4000), C020 TANK (4000),

    C021 TANK (4000), C022 TANK (4000), C023 TANK (4000), CHAR C024 (4000), SEE C025 TANK (4000),

    C026 TANK (4000), CHAR C027 (4000), C028 TANK (4000), C029 TANK (4000), C030 TANK (4000),

    C031 TANK (4000), C032 TANK (4000), C033 TANK (4000), C034 TANK (4000), C035 TANK (4000).

    C036 TANK (4000), C037 TANK (4000), C038 TANK (4000), C039 TANK (4000), C040 TANK (4000).

    C041 TANK (4000), C042 TANK (4000), C043 TANK (4000), C044 TANK (4000), C045 TANK (4000).

    C046 TANK (4000), C047 TANK (4000), C048 TANK (4000), C049 TANK (4000), C050 TANK (4000)

    )

    )

    LOCATION('''||) V_Temp_Filename | " ')

    )

    3 PARALLEL

    UNLIMITED RELEASE LIMIT ';

    . . .   E t c...

  • external table data with several locations pump

    Hello
    I'm on:
    Oracle Database 10 g Enterprise Edition release 10.2.0.3.0 - 64biit
    SunOS 5.10

    I am trying to create a table of data pump external at the same time, with the location of the files previously created using pump.
    This is the same as the example given in step 10-13 here:
    http://docs.Oracle.com/CD/B19306_01/server.102/b14215/et_dp_driver.htm#i1007502

    But when I do this and select all the lines in the resulting table, I get the error:

    ORA-29913: error in executing ODCIEXTTABLEFETCH legend
    ORA-29400: data cartridge error
    KUP-11011: file / < filepath > sys_tables.dmp is not valid for this load operation
    ORA-06512: at "SYS." ORACLE_DATAPUMP', line 52

    Can anyone help?
    Here is a script of what I do...


    create the directory message_archive_dir as ' / your/path/directory "; -change default directory
    -chmod 777 your way

    create the sys_tables table
    external organization
    (type ORACLE_DATAPUMP
    THE DEFAULT DIRECTORY MESSAGE_ARCHIVE_DIR
    LOCATION ("sys_tables.dmp"))
    AS
    Select object_id, object_type
    of object
    where owner = 'SYS '.
    and object_type = 'TABLE '.
    and rownum < 11;

    create the table sys_indexes
    external organization
    (type ORACLE_DATAPUMP
    THE DEFAULT DIRECTORY MESSAGE_ARCHIVE_DIR
    LOCATION ("sys_indexes.dmp"))
    AS
    Select object_id, object_type
    of object
    where owner = 'SYS '.
    and object_type = 'INDEX '.
    and rownum < 11;

    Select * from sys_tables
    Union
    Select * from sys_indexes;

    -all 20 rows returned!
    -now I combine the two dmp files in a single table...

    create the table sys_objects
    (
    object_id NUMBER (14).
    object_type VARCHAR2 (30)
    )
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_DATAPUMP
    THE DEFAULT DIRECTORY MESSAGE_ARCHIVE_DIR
    LOCATION ('sys_indexes.dmp', 'sys_tables.dmp')
    );

    Select *.
    of sys_objects
    where rownum = 1;

    -ok returnes one line (one of the dmp files work)
    --Choose so all lines...

    Select *.
    of sys_objects;

    ORA-29913: error in executing ODCIEXTTABLEFETCH legend
    ORA-29400: data cartridge error
    KUP-11011: file / < filepath > sys_tables.dmp is not valid for this load operation
    ORA-06512: at "SYS." ORACLE_DATAPUMP', line 52

    Can you see what I'm doing wrong?

    Any help is greatly appreciated!
    Thank you.

    user9969845 wrote:
    ... Etc...

    TYPE ORACLE_DATAPUMP
    THE DEFAULT DIRECTORY MESSAGE_ARCHIVE_DIR
    LOCATION ('sys_indexes.dmp', 'sys_tables.dmp')

    Combination dump files

    Files dump populated by different external tables can all be specified in the LOCATION of another external table clause. For example, data from different databases can be unloaded in separate files, and these files can then be included in an external table defined in a data warehouse. This provides an easy way to aggregate data from multiple sources. The only restriction is that the metadata for all external tables is exactly the same. This means that the game characters, time zone, schema name, table name, and column names must match. In addition, the columns must be defined in the same order, and their data types must be identical. This means that after you create the first external table you must remove it so that you can use the same table name for the second outer table. This ensures that the metadata in two dump files is the same and they can be used together to create the external table even.
    8 2

  • External table - interprated as link to a file location

    Hello everyone,

    I'm usigng of external tables for the first time. I using DB version 11.2.0.1.0

    I do the following:

    Create the directory:

    create the directory lip_test_dir as ' / daten/file_test/XML ";



    Create an external table

    CREATE TABLE lip_test (clob data)
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_LOADER
    Lip_test_dir default DIRECTORY
    ACCESS SETTINGS
    (
    FIELDS (lobfn TANK CANCEL BY EOF)
    TURNS COLUMN (data FROM lobfile (lobfn))
    )
    LOCATION ("2011103052820853_erp2eip_iteminventory_xml.xml")
    )
    REJECT LIMIT UNLIMITED;


    try to select data:

    Select * from lip_test;

    I get the following error:

    ORA-29913: error in executing ODCIEXTTABLEFATCH legend
    ORA-29400: data cartridge error


    Check the log file shows me that the charger open the xml file and tired to open for each line in the xml file, a new file. Messages are looking like this:

    KUP-04027: Dateinamenprufung nicht been: / daten/file_test/XML / <? XML version = "1.0" encoding = "UTF-8" standalone = 'no '? >
    Fehler beim Öffnen von Datei, daten, file_test, XML / <? XML version = "1.0" encoding = "UTF-8" standalone = 'no '? >
    KUP-04017: BS-message: no such file or directory
    KUP-04065: Fehler beim use LOBFILE as Feld DATEN von
    KUP-04101: Datensatz 1-Datei /daten/file_test/XML/2011103052820853_erp2eip_iteminventory_xml.xml zuruckgewiesen


    If <? XML version = "1.0" encoding = "UTF-8" standalone = 'no '? > is the first line in the XML file and tries to open it as a file.
    This is repeated for each line in the xml file.

    Can someone explain to my why this is happening. I have queryed www for this, but I don #t know what question exectly, so I found no useful result.


    I tried the following:

    Re-create the table and use a text file "test.txt" as location

    CREATE TABLE lip_test (clob data)
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_LOADER
    Lip_test_dir default DIRECTORY
    ACCESS SETTINGS
    (
    FIELDS (lobfn TANK CANCEL BY EOF)
    TURNS COLUMN (data FROM lobfile (lobfn))
    )
    LOCATION ("test.txt")*.
    )
    REJECT LIMIT UNLIMITED;


    In the test.txt file I just put the name of the XML file, so the value of the test.txt is

    2011103052820853_erp2eip_iteminventory_xml. XML


    Subsequently I query the table again:

    Select * from lip_test;

    No error just now came up! and the query shows me all the lines of 2011103052820853_erp2eip_iteminventory_xml.xml.

    I expected to see only the name of the file as it is written in test.txt, bt now I get the result that I expect when I put location (2011103052820853_erp2eip_iteminventory_xml.xml).


    Anyone know why this is happening?

    Thanks a lot for your help!

    Best regards from Germany
    Ml «»

    You will need to use the second approach, you mentioned above, with a file "test.txt" separate containing the name of the source.

  • External table does not appear

    DB = xe

    Hello
    I try to create an external table to refer to a csv file that contains the exif data for images. The data present exif date in the form 2011:12:03 following 16:47:27

    I built the external table as this;
    CREATE TABLE metadata_external
    ( sourcefile VARCHAR2 (255 CHAR)
    , createdate VARCHAR2 (255 CHAR)
    )
    ORGANIZATION EXTERNAL 
    ( TYPE ORACLE_LOADER
      DEFAULT DIRECTORY "UPLOAD_DIR"
      ACCESS PARAMETERS 
        ( RECORDS DELIMITED BY NEWLINE
          NOBADFILE
          NOLOGFILE
          FIELDS TERMINATED BY ','
          MISSING FIELD VALUES ARE NULL
          ( sourcefile
          , createdate
            )
              )
      LOCATION
        ( "UPLOAD_DIR":'metadata_external.csv'
          )
    ) REJECT LIMIT UNLIMITED;
    You will notice that I gave you the createdate column a varchar2 data type. This was to avoid any problems with formatting so that I could use the to_date function when inserting in the other tables.

    But the following code will not display anything that throws the following error;
    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 "minussign": expecting one of: "binary_double, binary_float, comma, char, date, defaultif, decimal, double, float, integer, (, nullif, oracle_date, oracle_number, position, raw, recnum, ), unsigned, varrawc, varchar, varraw, varcharc, zoned"
    KUP-01007: at line 8 column 1
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    I suspect that the: separator of date are causing problems.

    Anyone have some suggestions to solve this problem?

    Thank you
    Ben

    Try this out

    CREATE TABLE metadata_external
    (sourcefile VARCHAR2 (255 CHAR)
    date createdate
    )
    EXTERNAL ORGANIZATION
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY 'UPLOAD_DIR '.
    ACCESS SETTINGS
    (RECORDS DELIMITED BY NEWLINE
    NOBADFILE
    NOLOGFILE
    FIELDS TERMINATED BY ', '.
    MISSING FIELD VALUES ARE NULL
    (sourcefile
    createdate
    )
    )
    LOCATION
    (' UPLOAD_DIR"":'metadata_external.csv "')
    )
    ) REJECT LIMIT UNLIMITED;

    the createdate column, I guess that will contain exif data then leave as a date column, not as a varchar column.

    I have not test but try it.

    Good luck

    AbdurRahman

Maybe you are looking for

  • I can't locate the purpose of firefox to update on my mac

    Firefox crashes more often and I wonder if that got rid of the "about firefox" or so refreshing firefox button to fix the crash problem caused this problem (Image link/Dropbox: https://www.dropbox.com/s/u62zvis49dn4pfd/Screenshot%202015-06-26%2013.04

  • New Windows 10 install fails with error 0xC0000005

    I'm trying to install 10 Windows on a new iMac internal end 2015 5 K 27 "screen with a Fustion disc. I downloaded the file 10 ISO of Windows 64 bit. Then I started Bootcamp and pointed to the iso standard. Bootcamp created the partition, BOOTCAMP and

  • A word about the S-Log3 documentation?

    January has now rolled in February and I was wondering if there is any news of the S-Log3 documentation referred to in the release of firmware v3 display.

  • DAQmx Switch vs NI Switch vs IVI

    Hello just had information DAQmx switch screws are recommended to use written. Just to be sure... If I use IVI TestStand switching, I don't have to worry about it, I do? See you soon Oli

  • Could not get the money program to display.

    When I click on the silver desktop icon the progam briefly appears at startup but does not appear.In Task Manager msmoney.exe is listed in the process, but not in the Application list. Try to start the progam a 2nd time and message "money is already