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

Tags: Database

Similar Questions

  • SYSDATE post external table in the format 'YYMMDD '.

    I want to create an external table and add a sysdate with the YYMMDD format in the column of the table for an update. Thank you.

    entry would look like this:

    [email protected]


    create table ext_ID_REQ_table)
    account varchar2 (5).
    email varchar (85).
    date of date_update
    )

    (external) Organization
    type oracle_loader
    default directory user_dir
    (settings) access
    records delimited by newline
    BadFile ID_REQ_bad_dir:'ACCT_EMAIL%a_%p.bad'
    logfile ID_REQ_log_dir:'ACT_EMAIL%a_%p.log'
    fields)
    account position(1:5) char (5),
    e-mail position(6:90) tank (85),
    date_update char date_format date mask "YYMMDD") / I'm not sure of the syntax of date_update.
    )
    )
    location ("test.txt")
    )
    reject limit unlimited;

    mlojan wrote:
    It lies in the part parameters access and what the SYSDATE part?

    I misread your question. External tables do not support the built-in functions. And there is no need for this. Just use them to select in the external table. So get rid of the date_update column in the external table:

    create table ext_ID_REQ_table (
    account varchar2(5),
    email varchar(85)
    )
    
    organization external (
    type oracle_loader
    default directory user_dir
    access parameters (
    records delimited by newline
    badfile ID_REQ_bad_dir:'ACCT_EMAIL%a_%p.bad'
    logfile ID_REQ_log_dir:'ACT_EMAIL%a_%p.log'
    fields (
    account position(1:5) char(5),
    email position(6:90) char(85)
    )
    )
    location ('test.txt')
    )
    reject limit unlimited;
    

    Assume that the test.txt file is:

    A    [email protected]
    B    [email protected]
    C    [email protected]
    

    In select now use sysdate right:

    SQL> select  account,
      2          email,
      3          sysdate date_update
      4    from  ext_ID_REQ_table
      5  /
    
    ACCOU EMAIL                                                                                 DATE_UPDA
    ----- ------------------------------------------------------------------------------------- ---------
    A     [email protected]                                                                               15-JUN-10
    B     [email protected]                                                                               15-JUN-10
    C     [email protected]                                                                               15-JUN-10
    
    SQL> 
    

    SY.

  • error when reading flat file of external table... "ORA-01849: time must be between 1 and 12"

    My question is - is it possible for me to fix this error at the level of external table definition? Please advice

    Here is the data file I am trying to download...

    KSEA | 08-10 - 2015-17.00.00 | 83.000000 | 32.000000 | 5.800000

    KBFI | 2015-08-06 - 15.00.00 | 78.000000 | 35.000000 | 0.000000

    KSEA | 08-10 - 2015-11.00.00 | 73.000000 | 55.000000 | 5.800000

    KSEA | 08-08 - 2015-05.00.00 | 61.000000 | 90.000000 | 5.800000

    KBFI | 2015-08-06 - 16.00.00 | 78.000000 | 36.000000 | 5.800000

    KSEA | 2015-08-07 - 18.00.00 | 82.000000 | 31.000000 | 10.400000

    KSEA | 08-10 - 2015-00.00.00 | 65.000000 | 61.000000 | 4.600000

    KBFI | 08-08 - 2015-07.00.00 | 63.000000 | 84.000000 | 4.600000

    KSEA | 08-10 - 2015-15.00.00 | 81.000000 | 34.000000 | 8.100000

    This is the external table script

    CREATE TABLE MWATCH. MWATCH. WEATHER_EXT ".

    (

    LOCATION_SAN VARCHAR2 (120 BYTE),

    DATE OF WEATHER_DATETIME,

    NUMBER (16) TEMP.

    NUMBER (16) OF MOISTURE,

    WIND_SPEED NUMBER (16)

    )

    EXTERNAL ORGANIZATION

    (TYPE ORACLE_LOADER

    THE DEFAULT DIRECTORY METERWATCH

    ACCESS SETTINGS

    (records delimited by newline

    BadFile "METERWATCH": "weather_bad" logfile 'METERWATCH': 'weather_log '.

    fields ended by ' |' missing field values are null

    (location_san, WEATHER_DATETIME char date_format DATE mask "YYYY-mm-dd - hh.mi.ss", TEMPERATURE, MOISTURE, wind_speed)

    )

    LOCATION (METERWATCH: 'weather.dat')

    )

    REJECT LIMIT UNLIMITED

    PARALLEL (DEGREE 5 1 INSTANCES)

    NOMONITORING;

    Here is the error in the weather_bad which is generated files...

    column WEATHER_DATETIME of 55 error processing in the 1st row to the /export/home/camsdocd/meterwatch/weather.dat data file
    ORA - 01849ther_log.log 55 56 error processing column WEATHER_DATETIME in the row 1 for the /export/home/camsdocd/meterwatch/weather.dat data file
    5756 ORA - 01849ther_log.log: time must be between 1 and 12
    58column WEATHER_DATETIME 57 error during treatment number 2 for the /export/home/camsdocd/meterwatch/weather.dat data file
    59ORA-58 01849: time must be between 1 and 12
    60column WEATHER_DATETIME of 59 error processing 5th for the /export/home/camsdocd/meterwatch/weather.dat data file
    61ORA-60 01849: time must be between 1 and 12
    62column WEATHER_DATETIME of 61 error treatment in line 6 to the /export/home/camsdocd/meterwatch/weather.dat data file
    63ORA-62 01849: time must be between 1 and 12
    64column WEATHER_DATETIME of 63 error treatment in row 7 for datafile /export/home/camsdocd/meterwatch/weather.dat
    65ORA-64 01849: time must be between 1 and 12
    66column WEATHER_DATETIME of 65 error treatment 9 for the /export/home/camsdocd/meterwatch/weather.dat data file online
    67: time must be between 1 and 12

    My question is - is it possible for me to fix this error at the level of external table definition? Please advice

    Yes it is possible.  Let's not your date mask.  You're masking for 12-hour format when your data is in 24-hour format.  Change the mask of your date to be "YYYY-mm-dd-hh24. MI.ss ".  Notice the change in "BOLD".

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

  • Pretreatment of an external table - table is empty at the end

    Hello

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    PL/SQL Release 11.2.0.1.0 - Production

    "CORE 11.2.0.1.0 Production."

    AMT for Solaris: Version 11.2.0.1.0 - Production

    NLSRTL Version 11.2.0.1.0 - Production

    Solaris 10 x 86

    I'm trying to create an external table that first pre-process a file and then the bed. The problem is that, in the end, the outer table is empty even if the read file is not empty.

    First, the table works gunzip on the 'employees.csv.gz' file located in/export/home/oracle/archives and then bed. The file employees.csv.gz exists in the specified location. This is the complete script:

    -This Directory keeps the archived files

    CREATE or REPLACE DIRECTORY arch_dir AS 'archives/export/home/oracle/archives";

    -This directory shows where the command gunzip

    CREATE or REPLACE the bin_dir AS DIRECTORY ' / usr/bin';

    CREATE TABLE emp_exadata

    (

    employee_id NUMBER (22, 0),

    first name VARCHAR2 (20).

    last_name VARCHAR2 (25).

    e-mail VARCHAR2 (25).

    Phone_Number VARCHAR2 (20).

    hire_date DATE,

    job_id VARCHAR2 (10),

    higher wages (22: 2),

    commission_pct NUMBER 22 (2)

    manager_id NUMBER (22, 0),

    department_id NUMBER (22, 0)

    )

    EXTERNAL ORGANIZATION

    (

    TYPE oracle_loader

    Arch_dir default DIRECTORY

    ACCESS SETTINGS

    (

    RECORDS delimited BY NEWLINE

    preprocessor bin_dir: "gunzip".

    end fields BY «»

    missing field VALUES are NULL

    (

    employe_id,

    first name,

    last_name,

    E-mail

    Phone_Number,

    hire_date CHAR date_format DATE mask "dd-mm-yyyy hh24:mi:ss."

    job_id,

    salary,

    commission_pct,

    manager_id,

    department_id

    )

    )

    LOCATION ("employees_exp.csv.gz")

    )

    REJECT LIMIT UNLIMITED;

    When I choose to emp_exadata the result set is empty!

    SELECT * FROM emp_exadata;

    no selected line

    When I look at the db server in the directory /export/home/oracle/archives I see no archived file employees_exp.csv. Here is the result of the first three lines:


    bash - $3.2-3 employees_exp.csv head

    198, Donald, Ollivier, DOCONNEL, 650.507.9833, 21/06/2007 00:00:00, SH_CLERK, 2600, 124, 50,.

    199, Douglas, grant, DGRANT, 650.507.9844, 2008-01-13 00:00:00, SH_CLERK, 2600, 124, 50,.

    200 Jennifer Whalen, JWHALEN 515.123.4444, 17/09/2003 00:00:00, AD_ASST, 4400, 101, 10.

    The end of the lines in the file line is LF (unix style). The encoding is in ANSI format.

    I tried to experiment around, but cannot view records when I select in the external table. Please help me to solve it.

    I also register the generated log file:

    LOG file opened at 01/06/15 16:40:11

    For table EMP_EXADATA 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:

    EMPLOYEE_ID CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    FIRST NAME CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    LAST_NAME CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    EMAIL CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    PHONE_NUMBER CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    HIRE_DATE TANK (19)

    Day DATE data type, date mask dd-mm-yyyy hh24:mi:ss

    Completed by «,»

    Trim whitespace same as SQL Loader

    JOB_ID CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    SALARY CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    COMMISSION_PCT CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    MANAGER_ID CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    DEPARTMENT_ID CHAR (255)

    Completed by «,»

    Trim whitespace same as SQL Loader

    You need to carefully examine the description of the PREPROCESSOR option in the chapter of the manual external Tables utility.

    The first point that applies to your question is that the preprocessor must write its data transformed to stdout. To do this with gunzip, you use the - c command line parameter. The second point that applies to your case, in view of the answer to the first point, is that you must write a script shell if your preprocessor requires command line settings.

    Kind regards

    Bob

  • Access to an external table via the display in the UCM configuration manager problem

    Hi all

    I know that this question is already asked here: to access the external tables in DB / in UCM Applet configuration manager but the conversation has already been archived, and I can't comment there. I'm following approach given by William Phelps in above said archived thread.

    I am able to create dblink with data remote and created the view by using the linked table in my diagram of the Complutense University of Madrid. The problem that I face is that this point of view such as told by William is not visible in the configuration manager. Although I tried to give (create view and create all views) system diagram University Complutense of MADRID user privileges, but I'm not sure that it will also provide access rights. I am using the SQL Developer and working at the University Complutense of MADRID 11 g.

    All comment or suggestion will be a great help.

    Stéphane yapi

    The value of this configuration variable: EBRIncludeViewsInTableList = 1

    https://jonathanhult.com/blog/2013/11/use-database-view-WebCenter-content-schema-view/

    Jonathan

    http://jonathanhult.com

  • Loading external Table with quotes

    I have a file with fields in the file are as TAB delimiter ~ TAB.

    Example as below:

    QM ~ CD ~ Exzm ~ BMW

    DM ~ BD ~ Exzm ~ BMW

    CREATE TABLE test

    (

    Col_1 VARCHAR2 (100),

    Col_2 VARCHAR2 (100),

    Col_3 VARCHAR2 (100),

    Col_4 VARCHAR2 (100)

    )

    EXTERNAL ORGANIZATION

    (TYPE ORACLE_LOADER

    DEFAULT DIRECTORY 'Test_Report '.

    ACCESS SETTINGS

    (records delimited by '\n'

    CHARACTERSET 'UTF8 '.

    fields terminated by '\t~\t '.

    missing field values are null

    )

    LOCATION ("test.asc")

    )

    REJECT LIMIT UNLIMITED;

    OUTPUT:

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

    Data loaded in DB, but col_4 data comes from the quotation as below

    col_4

    -------

    "BMW".

    "BMW".

    Note: Col1 - col3 data arrives correctly.

    2807064 wrote:

    A finding on my side.

    I found that the values of Col_4 after inserting into DB with "transport return character" (CHR (13)) at the end of each value as shown below when I copy paste the value in notepad ++ "»

    Example:

    ----------

    "BMW".

    "

    But if I see the file I saw that BMW.

    My question is, in this case the external table loading must fail right? Why is this it is to load data in DB?

    Do you have this file begin life on windows, and then are transferred to * nix to serve an external table?  If so, which explains a lot.  Windows is the standard record delimiter x '0d0a' (Chr (13) 10)  On * nix, it's just x '0A' (10.  When the process of loader is scanning for record delimiter he's just looking for the '0A' x and x'd 0' gets included in the data.

    Two solutions-

    1 - Make sure that the data file is transferred so that the Records delimiters are converted.  It's supposed to to happen with ascii ftp mode, but this week I saw several examples in the House of it does not.

    2. attach your table definition external to seek the delimiter of actual recording instead of the default value of the operating system. == RECORDS DELIMITED BY X '0D0A '.

  • Bulk insert in an external table

    Hi, I get the error ora-29913, ora-01410 trying to do a bulk insert of external table

    INSERT

    IN CORE_TB_LOG

    (SELECT 'MODEL', 'ARCH_BH_MODEL', ROWID, "MODEL-D-000000001', - 45, 'A', SYSDATE, 'R'")

    OF ARCH_BH_MODEL1

    WHERE length (MOD_XCODIGO) > 10)

    INSERT

    *

    ERROR on line 1:

    ORA-29913: error in executing ODCIEXTTABLEFETCH legend

    ORA-01410: invalid ROWID

    ARCH_BH_MODEL1 is the external table.


    What's wrong?


    Thank you.

    Hello

    There is no ROWID in external tables.

    It makes sense: ROWID identifies where a line is stored in the database; It shows the data file and the block number in this file.

    External tables are not stored in the database.  They exist independently of any data file in the database.  The concept of an Oracle block does not apply to them.

    Why would you copy the ROWID, even if you could?

    Apart from ROWID and SYSDATE, you select only literals.  You don't want to select all the real data of the external table?

    What is the big picture here?  Post a small example of data (a CREATE TABLE statement and a small data file for the external table) and the desired results from these sample data (in other words, what core_tb_log must contain after INSERTION is complete.)  Explain how you get these results from data provided.

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

  • The Oracle 12 c memory option works with external tables?

    Hello

    Does anyone know if the external tables are also candidates for the benefit of the Oracle 12 c option in memory? I have read the documentation and white papers, and can't find any reference to external tables. If it is possible, we are very interested to know all about her, especially any limitation.

    Thank you.

    This is not the right forum for this question; This forum is for the memory of TimesTen database not Oracle database in memory option. These are completely different things.

    But it happens that I can tell you that no, external tables are not candidates for use with the In-Memory Option.

    Chris

  • External table Oracle via the Tables API

    Hello world

    I did experiment with the Oracle NoSQL database recently and I became a bit stuck with the new API of Tables. I have so far successfully of the external tables on the data entered using storage techniques 'vanilla' KV and avro (using generic and specific links) scheme, but create API Tables seems to be another matter entirely.

    My question arises in the trainer interface, which has a KeyValueVersion and a KVStore. I can't translate a KeyValueVersion created with the API of Tables in a primary key for recovery (since I don't know what the key generated by the API actually looks like to!) or map it on an avro scheme. The problem seems to be that the Tables API writes data in some format that can be easily translated into a string or an integer (releases from external table lines due to unknown characters if I am trying to retrieve all the values in the database to see what it looks like to), and try to map it to an AVRO map results in the error message 'the data are not as AVRO'.

    Scenario:

    I created a very simple table in the administration tool KV, which consists of a column personId (integer) that is PK, firstName, lastName, emailAddr (all channels) and enter 5 rows with success. What I want to do is to create an external table called person that returns just those 5 values (and brand new I add to the table of course). This means that I have to first understand what the parentKey value must be defined in the .dat file and how to take this key and it becomes a primary key for the recovery of the line.

    Faithful old Google could not find information on how to do this (he was only a thread similar to this with the answer "we'll add it soon"), so I hope that someone here managed to do!

    Thank you

    Richard

    Hi Richard

    I understand the issue you are facing. In the current version (12.1.3.0.9) the external tables feature only works with records of K/V not with the Table model, however, in the next version (which us will very soon be GA) we will support integration of external tables with the data of Table model as well. Please make sure that you have signed up for the announcement of release so that we can inform you of the release. I apologize for the inconvenience, he did to you.

    Best

    Anuj

    Sign up for announcements of NoSQL database , so we can warn you versions futures and other updates from the product of NoSQL database

  • Problem of null external Table spaces

    Hello

    I am trying to create an external table from a txt file. What follows is the file example.txt source: -.

    "FCl"."SCl"."TCL".
    "abcd"."MONTES.
    'xyx '."OMNI.""DESROSIERS.



    I'm on the bottom of SQL to create an external table with the help of above mentioned source file:-

    [code]

    CREATE TABLE some_data_1 (FCOLUMN VARCHAR2 (50))

    , SCOLUMN VARCHAR2 (50).

    TCOLUMN VARCHAR2 (50))

    EXTERNAL ORGANIZATION

    (TYPE oracle_loader

    DEFAULT DIRECTORY TESTS1

    ACCESS SETTINGS

    (RECORDS DELIMITED BY NEWLINE JUMP 1

    FIELDS TERMINATED BY '\t '.

    SURROUNDED OF POSSIBLY "" "

    MISSING FIELD VALUES ARE NULL)

    FCOLUMN, SCOLUMN, TCOLUMN))

    LOCATION ("example.txt"))

    [\code]


    Here it is the result that I am receiving is bad, if you check the source above, file you will notice that there is no value in first row, second column. But running under result that cell have been removed and third cell (GET) value moves...

    ABCDMONTES
    XYXOMNIDESROSIERS

    The following are the results except I do not get.

    ABCDMONTES
    XYXOMNI

    DESROSIERS

    Can someone help me in solving this external table skip the question of the null value?

    When to use possibly locked clause time SQL * Loader & external table of type oracle_loader cannot handle null values that are not hatched with delimiters. Get rid of clause eventually closed and trim encompassing qouble quotes in a query. Compare:

    SQL > CREATE TABLE some_data_1)
    2 FCOLUMN VARCHAR2 (50).
    3 SCOLUMN VARCHAR2 (50).
    4 TCOLUMN VARCHAR2 (50)
    5                          )
    6 EXTERNAL ORGANIZATION)
    7 TYPE oracle_loader
    8 DEFAULT TEMP DIRECTORY
    9 ACCESS (PARAMETERS
    10 RECORDS DELIMITED BY NEWLINE JUMP 1
    11 FIELDS TERMINATED BY '\t '.
    12 EVENTUALLY FRAMED BY "" "
    13 MISSING FIELD VALUES ARE NULL)
    14                                                                          FCOLUMN char(20),
    15                                                                          SCOLUMN char(20),
    16                                                                          TCOLUMN char(20)
    17                                                                         )
    18                                           )
    RENTAL ('sample.txt') 19
    20                         )
    21.

    Table created.

    SQL > COLUMN FCOLUMN FORMAT A20
    SQL > COLUMN SCOLUMN FORMAT A20
    SQL > COLUMN TCOLUMN FORMAT A20
    SQL > select *.
    2 of some_data_1
    3.

    FCOLUMN SCOLUMN TCOLUMN
    -------------------- -------------------- --------------------

    ABCD MONTES

    XYX OMNI DESROSIERS

    SQL > DROP TABLE some_data_1
    2.

    Deleted table.

    SQL > CREATE TABLE some_data_1)
    2 FCOLUMN VARCHAR2 (20).
    3 SCOLUMN VARCHAR2 (20).
    4 TCOLUMN VARCHAR2 (20)
    5                          )
    6 EXTERNAL ORGANIZATION)
    7 TYPE oracle_loader
    8 DEFAULT TEMP DIRECTORY
    9 ACCESS (PARAMETERS
    10 RECORDS DELIMITED BY NEWLINE JUMP 1
    11 FIELDS TERMINATED BY '\t '.
    12 MISSING FIELD VALUES ARE NULL)
    13                                                                          FCOLUMN char(50),
    14                                                                          SCOLUMN char(50),
    15                                                                          TCOLUMN char(50)
    16                                                                         )
    17                                           )
    18 RENTAL ('sample.txt')
    19                         )
    20.

    Table created.

    SQL > select regexp_replace (fcolumn,'^ '? ") (. *?)"? ($', '\1') fcolumn,.
    2 regexp_replace (scolumn,'^ '? ") (. *?)"? ($', '\1') scolumn,.
    3 regexp_replace (tcolumn,'^ '? ") (. *?)"? ($', '\1') tcolumn
    4 of some_data_1
    5.

    FCOLUMN SCOLUMN TCOLUMN
    -------------------- -------------------- --------------------

    ABCD MONTES

    XYX OMNI DESROSIERS

    SQL >

  • Refresh the Materialized View constructed from an external table commit?

    Is it possible to create a materialized with Refresh view on commit built from an external table?

    I think the answer is "no, because there is no way for the outer table report to the view materialized it has been changed," but I would like to be sure before I tell my client who has requested the opportunity to do this (or, Alternatively, to learn how Oracle hoops I have to cross in order to operate).

    I can create a Refresh on demand, it is not a question of not having the necessary permissions to create the materialized view itself.

    No, you can't. The outer table is not modified in a transactional way and there no materialized view logs, so there is no event to hang in and no delta to apply.

    However, you can use dbms_scheduler observer file that will ask for the presence of a file and load the data in a table or refresh a materialized view based on the external table.

    Justin

  • LTRIM in an external Table definition.

    Hello

    We use the Oracle 11.2.

    Because there is little documentation on the Web on no general external Table definitions, I would like to put this question out there.

    How can I insert a Ltrim function in an external table definition?

    Hello

    Here is an example that works on my system:

    CREATE TABLE     table_x
    (       num_id          NUMBER (2)
    ,     string_id     VARCHAR2 (2)
    ,     txt          VARCHAR2 (12)
    )
    ORGANIZATION EXTERNAL
    (     TYPE               oracle_loader
         DEFAULT DIRECTORY     my_dir
         ACCESS PARAMETERS (
                        RECORDS DELIMITED BY NEWLINE
                        FIELDS  (     num_id          CHAR (1)
                             ,     string_id     CHAR (2)
                             ,     txt          CHAR (12)     LTRIM
                             )
                            )
         LOCATION       ('table_x.txt')
    );
    

    Where the data file looks like this:

    1 A    abcdefgh
    1 A    ijklmnop
    1 A     pqrstuv
    1 B    abcdefgh
    1 B      ijklmn
    2 A    abcdefgh
    3 C          hi
    3 C       world
    

    With this example data, the LENGTH (string_id) is always 2 (in other words, each string_id begins with a space), but LENGTH (txt) varies from 2 to 8.

    I hope that answers your question.
    If not, post your CREATE TABLE statement (simplified as much as possible, but always with the same problem) and a few lines of the data file corresponding.

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

  • field of varchar2 external table storing only 255 bytes (4000 bytes)

    Hi all

    I was wondering if someone can tell me what im missing here.
    I have an external table with one column defined as varchar2 (4000 byte). the file contains a line with 255 characters (all the number 2 for simplicity). When I query the table, everything is fine. If I add 1 plus 2 chain (256 characters) it fails. im sure its something stupidly simple, but what am I missing? If he doesn't have to question fine up to 4000 characters?

    Thank you
    Dave

    I ran your testcase, thanks for that.
    Make sure you read the SQL and PL/SQL FAQ as well (the first thread sticky on this forum), he explains how to post the code formatted and many other things.

    In any case, the .log file gave me:

    LOG file opened at 07/18/11 20:05:33
    
    Field Definitions for table DAVEP2
      Record format DELIMITED, delimited by 0A
      Data in file has same endianness as the platform
      Rows with all null fields are accepted
    
      Fields in Data Source: 
    
        MY_STRING                       CHAR (255)
          Terminated by ","
          Enclosed by """ and """
          Trim whitespace same as SQL Loader
    

    So, what happens if you create the table as follows:

     CREATE TABLE davep2 (
       my_string         VARCHAR2(4000 BYTE)         NULL
     )
     ORGANIZATION EXTERNAL
       (  TYPE ORACLE_LOADER
          DEFAULT DIRECTORY FILE_TEST
          ACCESS PARAMETERS
            ( RECORDS DELIMITED BY  0x'0A'  BADFILE FILE_TEST:'davep2.bad'
      LOGFILE FILE_TEST:'davep2.log'
      FIELDS TERMINATED BY ',' optionally enclosed by '"' and '"'
      missing field values are null
       (
               my_string char(4000)
               ) )
          LOCATION (FILE_TEST:'DaveP.csv')) REJECT LIMIT 0 NOPARALLEL
    

Maybe you are looking for