Error in creating  External Table

I am following the following procedure to create an external table,but somehow i am not getting success.Can anyone pls explain the error?
CREATE OR REPLACE DIRECTORY TEST_DIR AS 'C:\TEST'
Directory created.
GRANT READ,WRITE ON DIRECTORY TEST_DIR TO PUBLIC
Grant succeeded.
CREATE TABLE external_table
(empno     NUMBER(4),
ename     VARCHAR2(10),
job     VARCHAR2(9),
mgr     NUMBER(4),
hiredate DATE,
sal     NUMBER(7, 2),
comm     NUMBER(7, 2),
deptno     NUMBER(2))
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY TEST_DIR
ACCESS PARAMETERS
(RECORDS DELIMITED BY NEWLINE
BADFILE 'TEST_DIR':'emp.bad'
LOGFILE 'TEST_DIR':'emp.log'
FIELDS TERMINATED BY ',')
LOCATION ('emp.csv'))
Table created.
The file emp.csv is located in TEST_DIR.
SELECT * FROM EXTERNAL_TABLE
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file emp.log
OS error The system cannot find the file specified.
ORA-06512: at "SYS.ORACLE_LOADER", line 19
-MS

quote from the docs:
"Note that READ or WRITE permission to a directory object means only that the Oracle database will read or write that file on your behalf. You are not given direct access to those files outside of the Oracle database unless you have the appropriate operating system privileges. Similarly, the Oracle database requires permission from the operating system to read and write files in the directories."
http://www.di.unipi.it/~ghelli/didattica/bdl/B19306_01/server.102/b14215/et_concepts.htm

Similar Messages

  • 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

  • Syntax Error, while Creating External Table

    Hi,
    Can anyone tell this Syntax is correct or not. And how it look like:
    CREATE TABLE emp_load (T_DATE DATE NOT NULL,
    T_NO DOUBLE PRECISION,
    T_TYPE CHAR(1),
    T_CO VARCHAR(30),
    T_CONTRACT DOUBLE PRECISION,
    T_PARTY VARCHAR(15),
    T_BILL_NO DOUBLE PRECISION,
    T_BILL_DATE DATE,
    T_QTY DOUBLE PRECISION,
    T_RATE DOUBLE PRECISION,
    T_BKG DOUBLE PRECISION NOT NULL,
    T_TAX DOUBLE PRECISION,
    T_OTHER DOUBLE PRECISION,
    T_DIV DOUBLE PRECISION,
    T_STAMPS DOUBLE PRECISION,
    T_DC_NO DOUBLE PRECISION,
    T_SPOT CHAR(2),
    T_CITY VARCHAR(3),
    T_ORDER DOUBLE PRECISION,
    T_TRADE DOUBLE PRECISION,
    T_TIME DATE,
    T_FORM CHAR(1),
    HEADER VARCHAR(2),
    T_DC_DATE DATE,
    T_POD VARCHAR(30),
    T_POD_DATE DATE,
    T_SET INTEGER,
    T_MARGIN DOUBLE PRECISION NOT NULL WITH DEFAULT,
    T_MKT_TYPE VARCHAR(3) NOT NULL,
    T_MEMBER_CODE VARCHAR(15),
    T_EXIM SMALLINT,
    T_P VARCHAR(15),
    T_C VARCHAR(30),
    T_TERM VARCHAR(8),
    T_CUST VARCHAR(12),
    T_SUBBKG DOUBLE PRECISION,
    T_BILL_TYPE VARCHAR(1),
    T_OPN_CLS DOUBLE PRECISION,
    T_AUCTION DOUBLE PRECISION,
    T_BRANCH VARCHAR(8),
    T_UNQID VARCHAR(20),
    T_SQ SMALLINT,
    T_CBKG DOUBLE PRECISION,
    T_COTHER DOUBLE PRECISION,
    T_MOD DATE,
    T_ORIG_CUST VARCHAR(20),
    T_TOT DOUBLE PRECISION,
    T_FIRM SMALLINT,
    T_ORDER_TIME DATE,
    T_NON_MT SMALLINT)
    ORGANIZATION EXTERNAL (TYPE ORACLE_LOADER DEFAULT DIRECTORY ext_tab_dir
    ACCESS PARAMETERS (RECORDS FIXED 62 FIELDS (T_DATE DATE NOT NULL,
    T_NO DOUBLE PRECISION,
    T_TYPE CHAR(1),
    T_CO VARCHAR(30),
    T_CONTRACT DOUBLE PRECISION,
    T_PARTY VARCHAR(15),
    T_BILL_NO DOUBLE PRECISION,
    T_BILL_DATE DATE,
    T_QTY DOUBLE PRECISION,
    T_RATE DOUBLE PRECISION,
    T_BKG DOUBLE PRECISION NOT NULL,
    T_TAX DOUBLE PRECISION,
    T_OTHER DOUBLE PRECISION,
    T_DIV DOUBLE PRECISION,
    T_STAMPS DOUBLE PRECISION,
    T_DC_NO DOUBLE PRECISION,
    T_SPOT CHAR(2),
    T_CITY VARCHAR(3),
    T_ORDER DOUBLE PRECISION,
    T_TRADE DOUBLE PRECISION,
    T_TIME DATE,
    T_FORM CHAR(1),
    HEADER VARCHAR(2),
    T_DC_DATE DATE,
    T_POD VARCHAR(30),
    T_POD_DATE DATE,
    T_SET INTEGER,
    T_MARGIN DOUBLE PRECISION NOT NULL WITH DEFAULT,
    T_MKT_TYPE VARCHAR(3) NOT NULL,
    T_MEMBER_CODE VARCHAR(15),
    T_EXIM SMALLINT,
    T_P VARCHAR(15),
    T_C VARCHAR(30),
    T_TERM VARCHAR(8),
    T_CUST VARCHAR(12),
    T_SUBBKG DOUBLE PRECISION,
    T_BILL_TYPE VARCHAR(1),
    T_OPN_CLS DOUBLE PRECISION,
    T_AUCTION DOUBLE PRECISION,
    T_BRANCH VARCHAR(8),
    T_UNQID VARCHAR(20),
    T_SQ SMALLINT,
    T_CBKG DOUBLE PRECISION,
    T_COTHER DOUBLE PRECISION,
    T_MOD DATE,
    T_ORIG_CUST VARCHAR(20),
    T_TOT DOUBLE PRECISION,
    T_FIRM SMALLINT,
    T_ORDER_TIME DATE,
    T_NON_MT SMALLINT))
    LOCATION ('BR271107.DAT'))
    Error at Command Line:28 Column:40
    Error report:
    SQL Error: ORA-00905: missing keyword
    00905. 00000 - "missing keyword"
    Thank u..!
    Ravi

    Where can we find that directory in the server. You have to provide for it's existence.
    So you must create C:/Oracle on the server or have your ext_tab_dir point to some existing directory on the server (better if dedicated to external tables for not creating confusion)
    You must also see to have read and write OS rights and have granted read (and write) privileges on directory ext_tab_dir to your_user_name
    Regards
    Etbin
    If you can use utl_file try to use utl_file_dir as your ext_tab_dir to perform the test => copy your file to the directory your utl_file_dir is pointing to and do select * from test
    Message was edited by: Etbin
    user596003

  • KUP-01005 error when selecting external table

    Hi All,
    My name is arun. I am having trouble resolving the following error. I tried to google, search oracle forum but no avail. I would really appreciate some help? I hope someone point me to the right direction with this problem. Thank you.
    Scenario :
    I have done the following :
    1. Created the external directories using a user account(KDEV199). However by default its owned by SYS user.
    2. Created the table necessary for selection. This was done by user account(KDEV199)
    3. I have granted the folder privileges owned by oinstall:oracle where the 2 physical files exists. Thus all the files is owned by oracle. This was done at OS layer.
    4. I have created 2 files necessary to extract data & read in oracle. This was done at OS layer.
    The problem is that i have the following when i try to select the table :
    SQL> select * from TEXN_IGM_MST;
    select * from TEXN_IGM_MST
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "minussign": expecting one of:
    "double-quoted-string, identifier, single-quoted-string"
    KUP-01007: at line 7 column 10
    This script used to create the table :
    --Create External Table
    CREATE TABLE texn_igm_mst
    COMP_NO CHAR(2),
    POL_NO CHAR(10),
    WRITING_AGENCY_NO_1 CHAR(10),
    WRITING_AGENT_NO_1 CHAR(10),
    WRITING_AGENCY_NO_2 CHAR(10),
    WRITING_AGENT_NO_2 CHAR(10),
    POL_STS_CDE CHAR(4),
    STS_CHNG_DT DATE,
    POL_DTE DATE,
    PAY_UP_DTE DATE,
    PAY_TO_DTE CHAR(10),
    MATURE_DTE DATE,
    PAY_MODE_CDE CHAR(2),
    PAY_METHOD_CDE CHAR(1),
    MODAL_PREM_AMT NUMBER(15,2),
    POL_CUR CHAR(2),
    NFO_CDE CHAR(1),
    DIVD_OPTION_CDE_1 CHAR(1),
    DIVD_OPTION_CDE_2 CHAR(1),
    OTHER_OPTION_CDE_1 CHAR(1),
    OTHER_OPTION_CDE_2 CHAR(1),
    RESTRICT_CDE CHAR(20),
    NEXT_MODAL_PREM NUMBER(15,2),
    SUSPEND_CDE CHAR(1),
    EXTRACT_DTE DATE,
    REASON_CDE CHAR(3),
    LINE_OF_BUSS CHAR(1),
    BILL_TO_DTE CHAR(10),
    DUE_DAY NUMBER(3),
    DAY_USE CHAR(1),
    PAR_TYPE CHAR(1),
    ISSUE_STATE CHAR(2),
    MED_CDE CHAR(1),
    RACE_CDE CHAR(1),
    ADMIT_CDE CHAR(1),
    REPT_STATE CHAR(2),
    COLL_OFF CHAR(2),
    WRITING_AGENCY CHAR(10),
    LAST_ANN_PROC CHAR(3),
    TIMESTAMP DATE,
    SPND_EFF_DT DATE,
    SPND_TRMN_DT DATE,
    SPND_USER_ID CHAR(8),
    CMPLN_AGT_ID CHAR(10),
    TOTAL_CWA DECIMAL(17),
    TOTAL_CWA_DT DATE,
    DELIVERY_DT DATE,
    REINSURED_CDE CHAR(1),
    SERV_AGENCY CHAR(10),
    ST_CODE CHAR(1),
    NFO_RULE CHAR(1),
    CSTAT_REASN_CD CHAR(2),
    REJ_REASN_CD CHAR(2)
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY external_dir_clmlog
    ACCESS PARAMETERS
    records delimited by newline
    BADFILE external_dir_clmlog:'VILFPM1.BAD'
    LOGFILE external_dir_clmlog:'VILFPM1.LOG'
    fields terminated by '!'
    missing field values are null
    --Column and format setting
    COMP_NO,
    POL_NO,
    WRITING_AGENCY_NO_1,
    WRITING_AGENT_NO_1,
    WRITING_AGENCY_NO_2,
    WRITING_AGENT_NO_2,
    POL_STS_CDE,
    STS_CHNG_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    POL_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_UP_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_TO_DTE,
    MATURE_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    PAY_MODE_CDE,
    PAY_METHOD_CDE,
    MODAL_PREM_AMT,
    POL_CUR,
    NFO_CDE,
    DIVD_OPTION_CDE_1,
    DIVD_OPTION_CDE_2,
    OTHER_OPTION_CDE_1,
    OTHER_OPTION_CDE_2,
    RESTRICT_CDE,
    NEXT_MODAL_PREM,
    SUSPEND_CDE,
    EXTRACT_DTE CHAR date_format DATE Mask "yyyy-mm-dd",
    REASON_CDE,
    LINE_OF_BUSS,
    BILL_TO_DTE,
    DUE_DAY,
    DAY_USE,
    PAR_TYPE,
    ISSUE_STATE,
    MED_CDE,
    RACE_CDE,
    ADMIT_CDE,
    REPT_STATE,
    COLL_OFF,
    WRITING_AGENCY,
    LAST_ANN_PROC,
    TIMESTAMP CHAR date_format DATE Mask "yyyy-mm-dd-hh24.mi.ss.ffffff",
    SPND_EFF_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    SPND_TRMN_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    SPND_USER_ID,
    CMPLN_AGT_ID,
    TOTAL_CWA,
    TOTAL_CWA_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    DELIVERY_DT CHAR date_format DATE Mask "yyyy-mm-dd",
    REINSURED_CDE,
    SERV_AGENCY,
    ST_CODE,
    NFO_RULE,
    CSTAT_REASN_CD,
    REJ_REASN_CD
    LOCATION (external_dir_clmxcom:'VILFPM1.DAT')
    DB version :
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    OS version :
    SUSE Linux Enterprise Server 11 (x86_64)
    VERSION = 11
    PATCHLEVEL = 1
    Linux KAITLSDS01 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux
    ---------------------------------------------------------------------------------------------------------------------------------------

    Pl see MOS Doc 302672.1 (Select From External Table Gives ORA-29913 ORA-29400 KUP-554 KUP-1005)
    Srini

  • Invalid number error when using external table

    Hello.
    I have a problem with creating an external table with number field.
    My txt file looks like:
    11111|text text|03718
    22222|text text text|04208
    33333|text|04215
    I try to create external table like:
    create table table_ex (
    id varchar2(5),
    name varchar2(100),
    old_id number(5))
    organization external (Type oracle_loader default directory dir
    access parameters(
    RECORDS DELIMITED BY NEWLINE
    fields terminated by '|'
    (id, name, old_id))
    location ('file.txt'));
    When i create the table and run select i get this in log file:
    Field Definitions for table TABLE_EX
    Record format DELIMITED BY NEWLINE
    Data in file has same endianness as the platform
    Rows with all null fields are accepted
    Fields in Data Source:
    ID CHAR (255)
    Terminated by "|"
    Trim whitespace same as SQL Loader
    NAME CHAR (255)
    Terminated by "|"
    Trim whitespace same as SQL Loader
    OLD_ID CHAR (255)
    Terminated by "|"
    Trim whitespace same as SQL Loader
    error processing column OLD_ID in row 1 for datafile
    /dir/file.txt
    ORA-01722: invalid number
    Whats the problem?
    Any idea?
    Thanks
    Message was edited by:
    DejanH

    Try this:
    create table table_ex
    id varchar2(5),
    name varchar2(100),
    old_id number
    organization external
    (Type oracle_loader default directory dir access parameters
    ( RECORDS DELIMITED BY NEWLINE fields terminated by '|'
    (id CHAR(5),
    name CHAR(100),
    old_id CHAR(5)
    location ('file.txt')
    I have removed the length of Number field and added length in characters later
    Aalap Sharma :)
    Message was edited by:
    Aalap Sharma

  • Can i create External Table dynamically

    Hi,
    Is it possible to create External Table dynamically ?
    I want to use the following dynamically to create External Table.
    1) fields
    2) field position
    3) file location
    Thanks

    The answer shouldn't be very different of already given answers in your Can i create external table dynamically? of the last month, is it ?
    And question is still same : why wanted such thing ?
    Nicolas.

  • Create external table in procedure

    i have a PL/SQL Block [ well i'm not created procedure still]
    /* Formatted on 2011/01/05 11:53 (Formatter Plus v4.8.8) */
    DECLARE
    -- create header
       p_formula_no                VARCHAR2 (200);
       p_formula_vers              NUMBER;
       p_formula_desc              VARCHAR2 (200);
       p_formula_desc2             VARCHAR2 (200);
       p_formula_class             VARCHAR2 (200);
       p_owner_organization_id     NUMBER;
       p_owner_id                  NUMBER;
       p_formula_type              NUMBER;
       p_scale_type                NUMBER;
       p_text_code                 NUMBER;
       p_last_update_date          DATE;
       p_auto_product_calc         VARCHAR2 (200);
       x_formula_id                NUMBER;
       x_return_code               VARCHAR2 (200);
       x_error_msg                 VARCHAR2 (200);
       formula_id                  NUMBER;
    -- update header
       p_formula_id                NUMBER;
       p_formula_status            VARCHAR2 (200);
       p_user_id                   NUMBER;
       p_last_update_date_orig     DATE;
       p_formulaline_id            NUMBER;
       p_line_type                 NUMBER;
       p_line_no                   NUMBER;
       p_item_id                   NUMBER;
       p_item_no                   VARCHAR2 (200);
       p_revision                  VARCHAR2 (200);
       p_qty                       NUMBER;
       p_item_um                   VARCHAR2 (200);
       p_release_type              NUMBER;
       p_scrap_factor              NUMBER;
       p_cost_alloc                NUMBER;
       p_phantom_type              NUMBER;
       p_rework_type               NUMBER;
       p_tp_formula_id             NUMBER;
       p_iaformula_id              NUMBER;
       p_scale_uom                 VARCHAR2 (200);
       p_contribute_step_qty_ind   VARCHAR2 (200);
       p_contribute_yield_ind      VARCHAR2 (200);
       p_scale_multiple            NUMBER;
       p_scale_rounding_variance   NUMBER;
       p_rounding_direction        NUMBER;
       p_by_product_type           VARCHAR2 (200);
       p_prod_percent              NUMBER;
    -- create header and update header cursors
       CURSOR c1
       IS
          SELECT DISTINCT formula_no, formula_ver, formula_desc, formula_class,
                          owner_header
                     FROM api_formula;
    -- for product cursors
       CURSOR c2
       IS
          SELECT *
            FROM api_formula
           WHERE line_type = 1;
    -- for ingredient cursors
       CURSOR c3
       IS
          SELECT *
            FROM api_formula
           WHERE line_type = -1;
       hdr                     c1%ROWTYPE;
       prod                        c2%ROWTYPE;
       ing                         c3%ROWTYPE;
    BEGIN
    -- for create and update header
       OPEN c1;
       FETCH c1
        INTO hdr;
       WHILE c1%FOUND
       LOOP
          p_formula_no := hdr.formula_no;
          p_formula_vers := hdr.formula_ver;
          p_formula_desc := hdr.formula_desc;
          p_formula_desc2 := NULL;
          p_formula_class := hdr.formula_class;
          p_owner_organization_id := 327;
          p_owner_id := 1298;
          p_formula_type := 0;
          p_scale_type := 0;
          p_text_code := 0;
          p_last_update_date := SYSDATE;
          p_auto_product_calc := 'Y';
          x_formula_id := NULL;
          x_return_code := NULL;
          x_error_msg := NULL;
          apps.gmd_formula_designer_pkg_cust.create_formula_header
                                                        (p_formula_no,
                                                         p_formula_vers,
                                                         p_formula_desc,
                                                         p_formula_desc2,
                                                         p_formula_class,
                                                         p_owner_organization_id,
                                                         p_owner_id,
                                                         p_formula_type,
                                                         p_scale_type,
                                                         p_text_code,
                                                         p_last_update_date,
                                                         p_auto_product_calc,
                                                         x_formula_id,
                                                         x_return_code,
                                                         x_error_msg
          COMMIT;
          SELECT formula_id
            INTO formula_id
            FROM fm_form_mst_b
           WHERE formula_no = hdr.formula_no;
          p_formula_id := formula_id;
          p_formula_no := NULL;
          p_formula_vers := NULL;
          p_formula_desc := NULL;
          p_formula_desc2 := NULL;
          p_formula_status := 700;
          p_formula_class := NULL;
          p_owner_organization_id := 327;
          p_owner_id := 1298;
          p_formula_type := 0;
          p_scale_type := 0;
          p_text_code := NULL;
          p_last_update_date := SYSDATE;
          p_user_id := 1298;
          p_last_update_date_orig := SYSDATE;
          p_auto_product_calc := 'Y';
          x_return_code := NULL;
          x_error_msg := NULL;
          apps.gmd_formula_designer_pkg_cust.update_formula_header
                                                         (p_formula_id,
                                                          p_formula_no,
                                                          p_formula_vers,
                                                          p_formula_desc,
                                                          p_formula_desc2,
                                                          p_formula_status,
                                                          p_formula_class,
                                                          p_owner_organization_id,
                                                          p_owner_id,
                                                          p_formula_type,
                                                          p_scale_type,
                                                          p_text_code,
                                                          p_last_update_date,
                                                          p_user_id,
                                                          p_last_update_date_orig,
                                                          p_auto_product_calc,
                                                          x_return_code,
                                                          x_error_msg
          DBMS_OUTPUT.put_line (x_return_code);
          DBMS_OUTPUT.put_line (x_error_msg);
          COMMIT;
          -- for PROD
          OPEN c2;
          FETCH c2
           INTO prod;
          WHILE c2%FOUND
          LOOP
             p_formula_id := formula_id;
             p_formulaline_id := NULL;
             p_line_type := 1;
             p_line_no := prod.line_no;
             p_item_id := prod.item_id;
             p_item_no := prod.item_name;
             p_revision := NULL;
             p_qty := prod.qty;
             p_item_um := prod.uom;
             p_release_type := 0;
             p_scrap_factor := 0;
             p_scale_type := 1;
             p_cost_alloc := 1;
             p_phantom_type := 0;
             p_rework_type := NULL;
             p_text_code := NULL;
             p_tp_formula_id := NULL;
             p_iaformula_id := NULL;
             p_scale_uom := NULL;
             p_contribute_step_qty_ind := NULL;
             p_contribute_yield_ind := NULL;
             p_scale_multiple := NULL;
             p_scale_rounding_variance := NULL;
             p_rounding_direction := NULL;
             p_by_product_type := NULL;
             p_last_update_date := SYSDATE;
             p_user_id := 1298;
             p_prod_percent := NULL;
             x_return_code := NULL;
             x_error_msg := NULL;
             apps.gmd_formula_designer_pkg.insert_formula_detail
                                                      (p_formula_id,
                                                       p_formulaline_id,
                                                       p_line_type,
                                                       p_line_no,
                                                       p_item_id,
                                                       p_item_no,
                                                       p_revision,
                                                       p_qty,
                                                       p_item_um,
                                                       p_release_type,
                                                       p_scrap_factor,
                                                       p_scale_type,
                                                       p_cost_alloc,
                                                       p_phantom_type,
                                                       p_rework_type,
                                                       p_text_code,
                                                       p_tp_formula_id,
                                                       p_iaformula_id,
                                                       p_scale_uom,
                                                       p_contribute_step_qty_ind,
                                                       p_contribute_yield_ind,
                                                       p_scale_multiple,
                                                       p_scale_rounding_variance,
                                                       p_rounding_direction,
                                                       p_by_product_type,
                                                       p_last_update_date,
                                                       p_user_id,
                                                       p_prod_percent,
                                                       x_return_code,
                                                       x_error_msg
             DBMS_OUTPUT.put_line (x_return_code);
             DBMS_OUTPUT.put_line (x_error_msg);
             COMMIT;
             FETCH c2
              INTO prod;
          END LOOP;
          -- for ing
          OPEN c3;
          FETCH c3
           INTO ing;
          WHILE c3%FOUND
          LOOP
             p_formula_id := formula_id;
             p_formulaline_id := NULL;
             p_line_type := -1;
             p_line_no := ing.line_no;
             p_item_id := ing.item_id;
             p_item_no := ing.item_name;
             p_revision := NULL;
             p_qty := ing.qty;
             p_item_um := ing.uom;
             p_release_type := 0;
             p_scrap_factor := 0;
             p_scale_type := 1;
             p_cost_alloc := 1;
             p_phantom_type := 0;
             p_rework_type := NULL;
             p_text_code := NULL;
             p_tp_formula_id := NULL;
             p_iaformula_id := NULL;
             p_scale_uom := NULL;
             p_contribute_step_qty_ind := NULL;
             p_contribute_yield_ind := NULL;
             p_scale_multiple := NULL;
             p_scale_rounding_variance := NULL;
             p_rounding_direction := NULL;
             p_by_product_type := NULL;
             p_last_update_date := SYSDATE;
             p_user_id := 1298;
             p_prod_percent := NULL;
             x_return_code := NULL;
             x_error_msg := NULL;
             apps.gmd_formula_designer_pkg.insert_formula_detail
                                                      (p_formula_id,
                                                       p_formulaline_id,
                                                       p_line_type,
                                                       p_line_no,
                                                       p_item_id,
                                                       p_item_no,
                                                       p_revision,
                                                       p_qty,
                                                       p_item_um,
                                                       p_release_type,
                                                       p_scrap_factor,
                                                       p_scale_type,
                                                       p_cost_alloc,
                                                       p_phantom_type,
                                                       p_rework_type,
                                                       p_text_code,
                                                       p_tp_formula_id,
                                                       p_iaformula_id,
                                                       p_scale_uom,
                                                       p_contribute_step_qty_ind,
                                                       p_contribute_yield_ind,
                                                       p_scale_multiple,
                                                       p_scale_rounding_variance,
                                                       p_rounding_direction,
                                                       p_by_product_type,
                                                       p_last_update_date,
                                                       p_user_id,
                                                       p_prod_percent,
                                                       x_return_code,
                                                       x_error_msg
             DBMS_OUTPUT.put_line (x_return_code);
             DBMS_OUTPUT.put_line (x_error_msg);
             COMMIT;
             FETCH c3
              INTO ing;
          END LOOP;
          FETCH c1
           INTO hdr;
       END LOOP;
       DBMS_OUTPUT.put_line (p_formula_id);
       DBMS_OUTPUT.put_line (x_return_code);
       DBMS_OUTPUT.put_line (x_error_msg);
    END;in this PL/SQL Block i'm used external table which is "API_FORMULA"
    the coding is
    create table api_formula
           ( FORMULA_NO varchar2(2000),
             FORMULA_VER NUMBER,
             FORMULA_DESC varchar2(2000),
             FORMULA_CLASS varchar2(2000),
             ORG NUMBER,
             OWNER_HEADER NUMBER,
             LINE_TYPE NUMBER,
           LINE_NO NUMBER,
             ITEM_ID NUMBER,
           ITEM_NAME VARCHAR2(2000),
           QTY NUMBER,
             UOM VARCHAR2(200),
             SCRAP_FAC NUMBER,
             SCRAP_TYPE NUMBER,
             UPDATE_DATE date,
             OWNER_LINE NUMBER,
               testt char(2)/*,
             future_use varchar2(200)*/
           organization external
           ( default directory ZAFAR
             access parameters
             ( records delimited by newline
               fields terminated by ','
             location ('HEADER.csv') 
    reject limit 100   
         ;i want this create external table statment in my Pl/SQL Block and when all the execution is complete then drop the table
    how it is possible??
    regard
    chintoo

    user11156570 wrote:
    @BluShadow
    ok .. i want to delete all rows from table in the end when execute this PL/SQLdelete all rows from what table?
    If you're referring to the external table, it's a file on the filesystem, you don't delete rows from it, you just replace/overwrite/delete the file as and when necessary.
    blushadow how i crate a reliable code.. can u suggest me?Basics of transactions... you commit when a business rule/process is complete, not for every little technical thing your code does. In your case I would expect a single commit at the end of the code.
    I don't have your tables, data or know what the code is supposed to be achieving, but you can bet your bottom dollar that if you're nesting cursor loops within each other then the code is running much slower than if you generated the data from a single SQL statement/cursor. I certainly have no clue what those procedure calls are doing, but it looks like they're using a load of OUT parameters. Are they user defined procedures or something that's part of e.g. Oracle Apps? If they're user defined I would consider redesigning all the code to use functions and pass back a structured data type with the required data.

  • ODI XML data server error while creating External databse tables.

    Hi,
    i am trying to create External database tables using XML data server.
    i am getting the following error,i have done this same thing for small xml files before.
    Java.sql.SQLException: ORA-00904: : invalid identifier
         at com.sunopsis.jdbc.driver.xml.bz.execute(bz.java)
         at com.sunopsis.jdbc.driver.xml.ca.execute(ca.java)
         at com.sunopsis.xmlfifth.b.u.a(u.java)
         at com.sunopsis.xmlfifth.b.bj.a(bj.java)
         at com.sunopsis.xmlfifth.b.bj.a(bj.java)
         at com.sunopsis.jdbc.driver.xml.u.a(u.java)
         at com.sunopsis.jdbc.driver.xml.u.g(u.java)
    Thanks,
    RK

    RK,
    With no details of how you configured the XML server, what were the parameters used in the configuration for using external database, etc, I dont know how much can someone help you.
    This is an Oracle error, so a few things that could be problematic with your "big" xml -
    1.) An element name could be of length > 30 characters (Oracle table name length limit is 30)
    2.) There are some special characters in the element name
    3.) Element name begins with a Number
    4.) Element name is an Oracle reserved word.
    This list can go on.

  • Error: while Selecting External table

    Hi everybody,
    When i Select an external table i am getting this error. The file is like this:
    229|1|506460|SIGROUP |4890|100|0|0|10:31:01|2007/12/17|M009|20191395001|L|B|12|CLIENT|INE547A01012|10:31:00|
    229|1|506460|SIGROUP |4900|900|0|0|10:31:01|2007/12/17|M009|20191395001|L|B|13|CLIENT|INE547A01012|10:31:00|
    229|1|500407|SWARAJENG |21400|300|0|0|10:33:28|2007/12/17|OWN|20191397001|L|B|154|OWN|INE277A01016|10:33:28|
    I had created the Table like this:
    SQL> CREATE TABLE TEMP_SAUDA
    2 (S_A VARCHAR2(20),
    3 S_TYPE VARCHAR2(20),
    4 S_CO VARCHAR2(20),
    5 S_CONAME VARCHAR2(40),
    6 S_RATE NUMBER,
    7 S_QTY NUMBER,
    8 S_G NUMBER,
    9 S_H NUMBER,
    10 S_TIME TIMESTAMP WITH TIME ZONE,
    11 S_DATE DATE,
    12 S_PCODE VARCHAR2(20),
    13 S_SETNO VARCHAR2(20),
    14 S_M VARCHAR2(20),
    15 S_N VARCHAR2(20),
    16 S_O VARCHAR2(20),
    17 S_CLIENTOWN VARCHAR2(10),
    18 S_ISIN VARCHAR2(12),
    19 S_ORDER_TIME TIMESTAMP WITH TIME ZONE
    20 )
    21 ORGANIZATION EXTERNAL
    22 (TYPE oracle_loader
    23 DEFAULT DIRECTORY BSE17122007
    24 ACCESS PARAMETERS
    25 (RECORDS DELIMITED BY NEWLINE
    26 FIELDS
    27 (
    28 S_A CHAR(20),
    29 S_TYPE CHAR(20),
    30 S_CO CHAR(20),
    31 S_CONAME CHAR(20),
    32 S_RATE CHAR(20),
    33 S_QTY CHAR(20),
    34 S_G CHAR(20),
    35 S_H CHAR(20),
    36 S_TIME CHAR(35) date_format TIMESTAMP WITH TIMEZONE mask "DD-MON-RR HH.MI.SSXFF AM TZH:TZM
    37 S_DATE CHAR(22) date_format DATE mask "mm/dd/yyyy hh:mi:ss ",
    38 S_PCODE CHAR(20),
    39 S_SETNO CHAR(20),
    40 S_M CHAR(20),
    41 S_N CHAR(20),
    42 S_O CHAR(20),
    43 S_CLIENTOWN CHAR(20),
    44 S_ISIN CHAR(20),
    45 S_ORDER_TIME date_format TIMESTAMP WITH TIMEZONE mask "DD-MON-RR HH.MI.SSXFF AM TZH:TZM"
    46 )
    47 )
    48 location (BSE17122007:'BR171207.DAT')
    49 )
    50 ;
    Table created.
    SQL> SELECT * FROM TEMP_SAUDA;
    SELECT * FROM TEMP_SAUDA
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "date_format": 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 21 column 14
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    Is there any mistake in this table creation.
    what i have to declare to the time format if the format in the file id hh:mm:ss
    Thank u...!
    Ravi

    The output you posted is completely wrong, I could not even create the table without errors.
    Try with this.
    CREATE TABLE TEMP_SAUDA
    (S_A VARCHAR2(20),
    S_TYPE VARCHAR2(20),
    S_CO VARCHAR2(20),
    S_CONAME VARCHAR2(40),
    S_RATE NUMBER,
    S_QTY NUMBER,
    S_G NUMBER,
    S_H NUMBER,
    S_TIME TIMESTAMP WITH TIME ZONE,
    S_DATE DATE,
    S_PCODE VARCHAR2(20),
    S_SETNO VARCHAR2(20),
    S_M VARCHAR2(20),
    S_N VARCHAR2(20),
    S_O VARCHAR2(20),
    S_CLIENTOWN VARCHAR2(10),
    S_ISIN VARCHAR2(12),
    S_ORDER_TIME TIMESTAMP WITH TIME ZONE
    ORGANIZATION EXTERNAL
    (TYPE oracle_loader
    DEFAULT DIRECTORY BSE17122007
    ACCESS PARAMETERS
    (RECORDS DELIMITED BY NEWLINE
    FIELDS terminated by "|"
    S_A CHAR(20),
    S_TYPE CHAR(20),
    S_CO CHAR(20),
    S_CONAME CHAR(20),
    S_RATE CHAR(20),
    S_QTY CHAR(20),
    S_G CHAR(20),
    S_H CHAR(20),
    S_TIME CHAR(8) date_format TIMESTAMP WITH TIMEZONE mask "HH.MI.SSXFF AM TZH:TZM",
    S_DATE CHAR(10) date_format DATE mask "yyyy/mm/dd",
    S_PCODE CHAR(20),
    S_SETNO CHAR(20),
    S_M CHAR(20),
    S_N CHAR(20),
    S_O CHAR(20),
    S_CLIENTOWN CHAR(20),
    S_ISIN CHAR(20),
    S_ORDER_TIME char(8) date_format TIMESTAMP WITH TIMEZONE mask "HH.MI.SSXFF AM TZH:TZM"
    location (BSE17122007:'BR171207.DAT')
    ;With this you get:
    SQL> col s_time format a40
    SQL> col s_date format a40
    SQL> col s_order_time format a40
    SQL> r
      1* select s_time,s_date,s_order_time from temp_sauda
    S_TIME                                   S_DATE                                   S_ORDER_TIME
    01-JAN-08 10.31.01.000000 AM +00:00      17.DEC.2007 00:00:00                     01-JAN-08 10.31.00.000000 AM +00:00
    01-JAN-08 10.31.01.000000 AM +00:00      17.DEC.2007 00:00:00                     01-JAN-08 10.31.00.000000 AM +00:00
    01-JAN-08 10.33.28.000000 AM +00:00      17.DEC.2007 00:00:00                     01-JAN-08 10.33.28.000000 AM +00:00Be aware that your file does not contain date information for the time fields, so as you see above it is defaulted to 01-JAN-08 for the S_TIME and S_ORDER_TIME column.

  • Error while importing external table

    Hello,
    I am getting the following error message when trying to import an external table:
    SQL Exception
    SQL Exception
    Repository Error:SQL Exception..
    Class Name: CacheMediator.
    Method Name: getDDEntryFromDB.
    Repository Error Message: ORA-22992: cannot use LOB locators selected from remote tables
    I am using the "import..."- function of "external tables" in warehouse target module. The external table is working correctly when accessing it via sqlplus.
    We are using owb version 10.2.0.1.
    Any help would be appreciated.
    Best regards
    Alexander

    My friends, this a documented BUG into Metalink, but there is no solution.
    I used a simple workaround:
    1. I created the external table into the database;
    2. I created the external table into the OWB repository;
    3. I DIDN'T DEPLOY THE EXTERNAL TABLE TO THE DATABASE;
    4. I used the external table into my mappings with no problems;
    5. Finishing, I deployed my mappings to the database without any errors.
    Hope to help!,
    Gustavo.

  • Error while accessing External table.

    Hi All,
    While accessing oracle external table. I created the table with the following query.
    CREATE OR REPLACE DIRECTORY load_dir AS '\\oraaps\Exceldata\'
    CREATE TABLE my_sheet
    DEPTNO NUMBER,
    DNAME VARCHAR2(14),
    LOC VARCHAR2(13)
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY load_dir
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    badfile load_dir:'my_sheet.bad'
    logfile load_dir:'my_sheet.log'
    FIELDS TERMINATED BY ','
    MISSING FIELD VALUES ARE NULL
    DEPTNO,
    DNAME,
    LOC
    LOCATION ('my_sheet.csv')
    )REJECT LIMIT UNLIMITED;
    I am sure that the table and the directory got created because i can see the table in the SQL developer. But whenever i say select * from my_sheet i'm getting the following error in the log file.
    LOG file opened at 10/16/06 14:48:21
    Field Definitions for table mysheet
    Record format DELIMITED BY NEWLINE
    Data in file has same endianness as the platform
    Rows with all null fields are accepted
    Fields in Data Source:
    DEPTNO NUMBER Terminated by ","
    Trim whitespace same as SQL Loader
    DNAME VARCHAR2(14),
    Terminated by ","
    Trim whitespace same as SQL Loader
    LOC VARCHAR2(13)
    Terminated by ","
    Trim whitespace same as SQL Loader
    KUP-04001: error opening file \\oraaps\Exceldata\mysheet.csv
    KUP-04017: OS message: The data is invalid.
    Please do reply..Its urgent from my project deliverable point of view.
    Any help appreciated.
    Thanks and Regards.
    V.Venkateswara Rao

    It is not an Oracle error/problem. The error message is quite specific ito the actual root cause of the problem:
    KUP-04001: error opening file \\oraaps\Exceldata\mysheet.csv
    KUP-04017: OS message: The data is invalid.
    These are operating system errors. The operating system cannot access/open/read the specific UNC and/or file.
    Fix it at o/s level and it will work when Oracle needs to make that o/s call.

  • Error while using External Table

    Hi Guru's,
    I am using external tables in my procedure and the code to create it will be dynamically built inside the procedure itself. I have tested it so many times and it works fine only. But suddenly now it is throwing some error and i was not able to figure out the problem.
    Additional Info:
    1. I have provided the full rights to the input directory.
    2. Working in Oracle 10g release 2
    3. Unix OS in server
    4. Error description:
    << UK_TRADINGDATA_LOAD >> ABEND : <<ABEND SYS-000 >> uncatched ORACLE-error : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file EXTRACTION COMPLETED in EXT_UK_TRADINGDATA not found
               v_ac_sql:='CREATE TABLE VLDPROCESS'||gv_ac_schema_suffix||'.EXT_UK_TRAD_'||gv_ac_machineid ||'_'||gv_ac_retailer_id||'_ADHOC'||CHR(10)
                            ||'(  AC_RETAILER_ID       VARCHAR2(2 BYTE),'||CHR(10)
                            ||'AC_DEPARTMENT_CD     VARCHAR2(20 BYTE),'||CHR(10)
                            ||'NC_PERIOD_FROM       NUMBER,'||CHR(10)
                            ||'NC_PERIOD_TO       NUMBER'||CHR(10)   
                            ||')'||CHR(10)
                            ||'ORGANIZATION EXTERNAL'||CHR(10)
                            ||'(TYPE ORACLE_LOADER'||CHR(10)
                            ||'DEFAULT DIRECTORY EXT_UK_TRADINGDATA'||CHR(10)
                            ||'ACCESS PARAMETERS'||CHR(10)
                            ||'(RECORDS DELIMITED BY NEWLINE'||CHR(10)
                            ||'badfile     '''||v_ac_failed_files||'.bad'''||CHR(10)
                            ||'discardfile '''||v_ac_failed_files||'.dis'''||CHR(10)
                            ||'logfile     '''||v_ac_failed_files||'.log'''||CHR(10)
                            ||'FIELDS'||CHR(10)
                            ||'('||CHR(10)
                            ||'AC_RETAILER_ID   position( 1: 2) char( 2),'||CHR(10)
                            ||'AC_DEPARTMENT_CD position( 3:22) char(20),'||CHR(10)
                            ||'NC_PERIOD_FROM   position(23:29) char( 7),'||CHR(10)
                            ||'NC_PERIOD_TO     position(30:36) char( 7)'||CHR(10)     
                            ||')'||CHR(10)
                            ||')'||CHR(10)
                            ||'LOCATION ('''||v_ac_file_name ||''')'||CHR(10)
                            ||')'||CHR(10)
                            ||'REJECT LIMIT 100'||CHR(10)
                            ||'NOPARALLEL'||CHR(10)
                            ||'NOMONITORING';  
               EXECUTE IMMEDIATE v_ac_sql; Kindly help me!
    With Regards,
    VJ

    Sometimes when troubleshooting issues like this it is helpful to output the dynamic SQL generated to the screen or spool it to a text file. From there it's usually easy to determine where the problem lies.
    If you can provide that one of the forum members can figure it out.

  • OWB 10g R1 : Error  while accessing External Table

    Dear All,
    We have created few external and registered them using os user oracle.
    Now , we have changed to user 'oratester' and reregistered the location.
    oratester is having all the rights on the folder which the external table is refering.
    Still , we are facing with the following error:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error KUP-04063: unable to open log file log_test.txt OS error Permission denied
    If anybody is having any idea how to solve this error, please reply
    Thanks in Advance
    malle

    yah. Ive configured the accessing parameters.
    The code generated , has the following
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE
    CHARACTERSET WE8MSWIN1252
    STRING SIZES ARE IN BYTES
    BADFILE ALL_DB_LOC_CMN_FLS_LOG_LOC:'bad_central.txt'
    DISCARDFILE ALL_DB_LOC_CMN_FLS_LOG_LOC:'discard_central.txt'
    LOGFILE ALL_DB_LOC_CMN_FLS_LOG_LOC:'log_central.txt'
    FIELDS
    TERMINATED BY '~'
    OPTIONALLY ENCLOSED BY '"' AND '"'
    Which OS does oracle use to create log/bad files?

  • Error:loading from external table to database table

    hi,
    Following error comes while inserting data from external to new_ext table
    what might be the reason??
    error and external table creation script is as follows
    regards,
    Avinash
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-29400: data cartridge error
    KUP-04020: found record longer than buffer size supported, 524288, in
    /home/oracle/rgtr1.txt
    ORA-06512: at " SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    ORA-06512: at "PRODNDBA.PROC_RGTR1", line 513
    ORA-06512: at line 1
    external table script is as follows:
    DROP
    TABLE EXT_TABLE_RGTR1 CASCADE CONSTRAINTS;
    CREATE
    TABLE EXT_TABLE_RGTR1
    ID
    VARCHAR2(10 BYTE),
    PC
    VARCHAR2(2 BYTE),
    BU
    VARCHAR2(4 BYTE),
    CONSUMER_NO
    VARCHAR2(12 BYTE),
    CUR_READING1
    NUMBER,
    CUR_READING2
    NUMBER,
    ADJ_CONS1
    NUMBER,
    ADJ_CONS2
    NUMBER,
    TOT_EC
    NUMBER,
    TOT_FCA
    NUMBER,
    TOT_ED
    NUMBER,
    ADDLESS_AMT
    NUMBER,
    NETBILL_AMT
    NUMBER,
    ADJ_UNIT1
    NUMBER,
    ADJ_UNIT2
    NUMBER,
    TARIFF_CODE
    NUMBER,
    DUTY_CODE
    NUMBER,
    DISCONN_TAG
    VARCHAR2(1 BYTE),
    MIN_CHRG_IND
    VARCHAR2(1 BYTE),
    OC_CODE1
    VARCHAR2(1 BYTE),
    OC_CODE2
    VARCHAR2(1 BYTE),
    OC_AMT1
    NUMBER,
    OC_AMT2
    NUMBER,
    PREV_DPC
    NUMBER,
    CREDIT_AVG_BILL
    NUMBER,
    ADJ_TYPES
    NUMBER,
    ADJ_EC_FCA
    NUMBER,
    ADJ_ED
    NUMBER,
    ADJ_AMT1
    NUMBER,
    ADJ_AMT2
    NUMBER,
    ADJ_AMT3
    NUMBER,
    ADJ_AMT4
    NUMBER,
    ADJ_AMT5
    NUMBER,
    ADJ_AMT6
    NUMBER,
    ADJ_AMT7
    NUMBER,
    ADJ_AMT8
    NUMBER,
    MR_CYCLE
    VARCHAR2(2 BYTE),
    NOTICE
    VARCHAR2(2 BYTE),
    INSTAL_IND
    VARCHAR2(1 BYTE),
    LAST_RCPT_DT
    VARCHAR2(6 BYTE),
    MS1
    NUMBER,
    MS2
    NUMBER,
    ARR_PL_CR
    NUMBER,
    PREV_READ1
    NUMBER,
    PREV_READ2
    NUMBER,
    OLD_CONS_NUM
    VARCHAR2(16 BYTE),
    MTR_CODE1
    VARCHAR2(2 BYTE),
    MTR_CODE2
    VARCHAR2(2 BYTE),
    ABR_EC1
    NUMBER,
    ABR_FCA1
    NUMBER,
    REV_CAT
    VARCHAR2(2 BYTE),
    BILL_DT
    DATE,
    SD_PAID
    NUMBER,
    SD_ARRS
    NUMBER,
    SD_ADDL
    NUMBER,
    PR_RDNG_IND1
    VARCHAR2(1 BYTE),
    PR_RDNG_IND2
    VARCHAR2(1 BYTE),
    NAB_IND
    VARCHAR2(1 BYTE),
    CONN_LOAD
    NUMBER,
    OLDEST_OS_DT
    VARCHAR2(4 BYTE),
    ABR_RECAMT1
    NUMBER,
    METER_RENT
    NUMBER,
    EX_DUTY
    NUMBER,
    TDL_CHARGES
    NUMBER,
    ABR_MTH
    VARCHAR2(4 BYTE),
    READING_IND
    VARCHAR2(1 BYTE),
    FB_IND
    VARCHAR2(1 BYTE),
    ADJ_AMT
    NUMBER,
    MTR_NUM1
    NUMBER,
    MTR_NUM2
    NUMBER,
    AVG_UNITS1
    NUMBER,
    AVG_UNITS2
    NUMBER,
    MIN_BILL_AMT
    NUMBER,
    METER_COST_DEMANDED
    NUMBER,
    MF1
    VARCHAR2(2 BYTE),
    MF2
    VARCHAR2(2 BYTE),
    MR
    VARCHAR2(2 BYTE),
    ROUTE
    VARCHAR2(4 BYTE),
    SEQ
    VARCHAR2(4 BYTE),
    DISC_IND
    VARCHAR2(1 BYTE),
    FREEZE_CODE
    VARCHAR2(1 BYTE),
    MTH40
    NUMBER,
    CONCES_EC
    NUMBER,
    METER_COST_ARREARS
    NUMBER,
    METER_COST_PAID
    NUMBER,
    SANCTION_LOAD
    NUMBER,
    PENALTY_ON_CL
    NUMBER,
    CL_SLB
    NUMBER,
    UNTSLB
    NUMBER,
    CAPACIT_PENALTY
    NUMBER,
    ARREARS_OF_INT
    NUMBER,
    INT_ON_ARREARS
    NUMBER,
    FIXED_CHARGES
    NUMBER,
    ASSESSED_DPC
    NUMBER,
    FCA_UNT_OLD
    NUMBER,
    FCA_UNT_NEW
    NUMBER,
    DEFECT_RDN1
    NUMBER,
    DEFECT_RDN2
    NUMBER,
    CAP_CT_RENT
    NUMBER,
    CT_RENT
    NUMBER,
    ADV_BILL_IND
    VARCHAR2(1 BYTE),
    ADV_BILL_RD_IND
    VARCHAR2(1 BYTE),
    INST_IND
    VARCHAR2(1 BYTE),
    CONSCUR_STATUS
    VARCHAR2(1 BYTE),
    MTR_COST1
    NUMBER,
    MTR_COST2
    NUMBER,
    MTR_COST3
    NUMBER,
    LOOM_NOS
    NUMBER,
    CONS_OLD_TARIFF
    NUMBER,
    CONS_NEW_TARIFF
    NUMBER,
    PD_TD_DATE
    VARCHAR2(6 BYTE),
    ED5
    VARCHAR2(10 BYTE),
    ED6
    VARCHAR2(10 BYTE),
    ED8
    VARCHAR2(10 BYTE),
    B66_AMT1
    NUMBER,
    BILL_MTH
    VARCHAR2(6 BYTE),
    STD_MTH
    NUMBER,
    PREV_RD_MTH
    VARCHAR2(4 BYTE),
    ACCT_HD_TRF
    VARCHAR2(2 BYTE),
    ADM_CODE
    NUMBER,
    BILL_DUE_DATE
    DATE,
    EC_DUTY
    NUMBER,
    ABNOR_IND
    VARCHAR2(1 BYTE),
    TRF04_CONN_LOAD
    NUMBER,
    PROCESS_DT
    DATE,
    SUPPLY_DATE
    VARCHAR2(6 BYTE),
    BILL_DT_FROM
    DATE,
    RECEIPT_AMT
    NUMBER,
    LOCKED_CR_UNITS
    NUMBER,
    LOCKED_CHARGES
    NUMBER,
    LOCKED_ED
    NUMBER,
    LOCKED_FCA
    NUMBER,
    LOCKED_FC
    NUMBER,
    LOCKED_RLCHARGES
    NUMBER,
    LOCKED_CL
    NUMBER,
    LOCKED_ECEDFIX
    NUMBER,
    LOCKED_ACC_MONTH
    NUMBER,
    AVG_OLD_CONSMP
    NUMBER(6),
    AVG_SINCE
    VARCHAR2(4 BYTE),
    AVG_OCCURANCES
    NUMBER(2),
    AVG_MA_IND
    VARCHAR2(1 BYTE),
    MTR1_PHASE
    NUMBER(1),
    MTR_PHASE1
    VARCHAR2(1 BYTE),
    MTR2_PHASE
    NUMBER(1),
    IND_CAT
    VARCHAR2(1 BYTE),
    L61_TARIFF
    NUMBER(2),
    MTR_CHG_AMT1
    NUMBER(12),
    NO_OF_MONTHS
    NUMBER,
    MTR_CHG_AMT2
    NUMBER(12),
    B66_AMT
    NUMBER(10),
    ADJ_AMT11
    NUMBER,
    B66_ADJ_TYP
    VARCHAR2(1 BYTE),
    B60_AMT
    NUMBER(10),
    ADJ_AMT13
    NUMBER,
    B60_ADJ_TYP
    VARCHAR2(1 BYTE),
    CPF_NO
    NUMBER(8),
    ADJ1
    NUMBER(9),
    ADJ2
    NUMBER(9),
    ADJ3
    NUMBER(9),
    ADJ4
    NUMBER(9),
    ADJ5
    NUMBER(9),
    ADJ6
    NUMBER(9),
    ADJ7
    NUMBER(9),
    ADJ8
    NUMBER(9),
    ADJ11
    NUMBER(9),
    ADJ13
    NUMBER(9),
    DTC_CODE
    VARCHAR2(7 BYTE),
    TITLE
    VARCHAR2(8 BYTE),
    NAME
    VARCHAR2(36 BYTE),
    ADDRESS1
    VARCHAR2(26 BYTE),
    ADDRESS2
    VARCHAR2(26 BYTE),
    VILLAGE
    VARCHAR2(14 BYTE),
    PIN
    VARCHAR2(6 BYTE),
    LOCK_SINCE
    VARCHAR2(4 BYTE),
    FAULTY_SINCE
    VARCHAR2(4 BYTE),
    MTR_DIGIT1
    VARCHAR2(1 BYTE),
    MTR_DIGIT2
    VARCHAR2(1 BYTE),
    FCA_PAISE
    NUMBER(9),
    GTY_EXP_DT
    VARCHAR2(6 BYTE),
    REJ_READ_MTR1
    NUMBER(6),
    REJ_READ_MTR2
    NUMBER(6),
    REJ_ADJ_UNITS1
    NUMBER(6),
    REJ_CONSMP
    NUMBER(6),
    OWNER_CODE
    NUMBER(1),
    MTR_CAP_AMP
    NUMBER(1),
    MTR_A
    VARCHAR2(1 BYTE),
    MTR_C
    VARCHAR2(1 BYTE),
    MTR_D
    VARCHAR2(1 BYTE),
    MTR_E
    VARCHAR2(1 BYTE),
    CUT_OF_DT
    DATE,
    POLE
    VARCHAR2(6 BYTE),
    EDRATE
    NUMBER(9),
    AREA
    VARCHAR2(1 BYTE),
    MTR_BRAND1
    VARCHAR2(2 BYTE),
    MTR_BRAND2
    VARCHAR2(2 BYTE),
    LC1
    NUMBER(3),
    POWER_CUT_IND
    VARCHAR2(1 BYTE),
    SERVICE_DT
    DATE,
    ADJ_UNIT11
    NUMBER,
    ADJ_UNIT22
    NUMBER,
    RECEIPT_AMT1
    NUMBER,
    MTR1
    NUMBER,
    STRK_BLL_AMT
    NUMBER,
    DUTY_UNTS1
    NUMBER,
    DUTY_AMT1
    NUMBER,
    DUTY_UNTS2
    NUMBER,
    DUTY_AMT2
    NUMBER,
    DUTY_UNTS3
    NUMBER,
    DUTY_AMT3
    NUMBER,
    ADJ_UNIT_45
    NUMBER,
    ADV_BIL_EC
    NUMBER,
    NEW_DUTY_RATE
    NUMBER,
    NEW_DUTY_UNTS
    NUMBER,
    NEW_DUTY_AMT
    NUMBER,
    DPC_PAB
    NUMBER,
    MS9_SINCE
    VARCHAR2(4 BYTE),
    DISTRICT_CODE
    NUMBER(2),
    TAX_ON_SALE
    NUMBER,
    LOCKED_CHARGES_TSE
    NUMBER
    ORGANIZATION
    EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY EXT_DIR
    ACCESS PARAMETERS
    ( records delimited by newline
    badfile
    'ext.bad'
    logfile 'ext.log'
    fields
    ID POSITION
    (1-4),
    PC POSITION
    (7-7),
    BU POSITION
    (8-11),
    CONSUMER_NO POSITION
    (18-29 ),
    CUR_READING1 POSITION
    (33-41 ),
    CUR_READING2 POSITION
    (42-50 ),
    ADJ_CONS1 POSITION
    (51-59 ),
    ADJ_CONS2 POSITION
    (60-68 ),
    TOT_EC POSITION
    (69-86),
    TOT_FCA POSITION
    (87-104 ),
    TOT_ED POSITION
    (105-122 ),
    ADDLESS_AMT POSITION
    (123-140 ),
    NETBILL_AMT POSITION
    (141-158 ),
    ADJ_UNIT1 POSITION
    (159-167 ),
    ADJ_UNIT2 POSITION
    (168-176 ),
    TARIFF_CODE POSITION
    (177-178 ),
    DUTY_CODE POSITION
    (179-180 ),
    DISCONN_TAG POSITION
    (181-181 ),
    MIN_CHRG_IND POSITION
    (182-182 ),
    OC_CODE1 POSITION
    (183-183 ),
    OC_CODE2 POSITION
    (184-184 ),
    OC_AMT1 POSITION
    (185-202 ),
    OC_AMT2 POSITION
    (203-220 ),
    PREV_DPC POSITION
    (221-238 ),
    CREDIT_AVG_BILL POSITION
    (239-256 ),
    ADJ_TYPES POSITION
    (257-264 ),
    ADJ_EC_FCA POSITION
    (265-282 ),
    ADJ_ED POSITION
    (283-300 ),
    ADJ_AMT1 POSITION
    (301-318 ),
    ADJ_AMT2 POSITION
    (319-336 ),
    ADJ_AMT3 POSITION
    (337-354 ),
    ADJ_AMT4 POSITION
    (355-372 ),
    ADJ_AMT5 POSITION
    (373-390 ),
    ADJ_AMT6 POSITION
    (391-408 ),
    ADJ_AMT7 POSITION
    (409-426 ),
    ADJ_AMT8 POSITION
    (427-444 ),
    MR_CYCLE POSITION
    (445-446 ),
    NOTICE POSITION
    (447-448 ),
    INSTAL_IND POSITION
    (449-449 ),
    LAST_RCPT_DT POSITION
    (453-458 ),
    MS1 POSITION
    (459-459),
    MS2 POSITION
    (460-460),
    ARR_PL_CR POSITION
    (461-478 ),
    PREV_READ1 POSITION
    (479-487 ),
    PREV_READ2 POSITION
    (488-496 ),
    OLD_CONS_NUM POSITION
    (497-512 ),
    MTR_CODE1 POSITION
    (513-514 ),
    MTR_CODE2 POSITION
    (515-516 ),
    ABR_EC1 POSITION
    (517-534 ),
    ABR_FCA1 POSITION
    (535-552 ),
    REV_CAT POSITION
    (553-554 ),
    BILL_DT POSITION
    (555-560 ) DATE "DDMMYY",
    SD_PAID POSITION
    (561-569 ),
    SD_ARRS POSITION
    (570-578 ),
    SD_ADDL POSITION
    (579-587 ),
    PR_RDNG_IND1 POSITION
    (588-588 ),
    PR_RDNG_IND2 POSITION
    (589-589 ),
    NAB_IND POSITION
    (590-590 ),
    CONN_LOAD POSITION
    (592-600 ),
    OLDEST_OS_DT POSITION
    (601-604 ),
    ABR_RECAMT1 POSITION
    (605-622 ),
    METER_RENT POSITION
    (623-631 ),
    EX_DUTY POSITION
    (632-649 ),
    TDL_CHARGES POSITION
    (632-649 ),
    ABR_MTH POSITION
    (650-651 ),
    READING_IND POSITION
    (652-652 ),
    FB_IND POSITION
    (653-653 ),
    ADJ_AMT POSITION
    (654-671 ),
    MTR_NUM1 POSITION
    (672-681 ),
    MTR_NUM2 POSITION
    (682-691 ),
    AVG_UNITS1 POSITION
    (692-700 ),
    AVG_UNITS2 POSITION
    (701-709 ),
    MIN_BILL_AMT POSITION
    (710-727 ),
    METER_COST_DEMANDED POSITION
    (710-727 ),
    MF1 POSITION
    (728-729),
    MF2 POSITION
    (730-731),
    MR POSITION
    (732-733),
    ROUTE POSITION
    (734-737),
    SEQ POSITION
    (738-741),
    DISC_IND POSITION
    (742-742 ),
    FREEZE_CODE POSITION
    (743-743 ),
    MTH40 POSITION
    (744-752),
    CONCES_EC POSITION
    (753-770 ),
    METER_COST_ARREARS POSITION
    (753-770 ),
    METER_COST_PAID POSITION
    (771-788 ),
    SANCTION_LOAD POSITION
    (789-797 ),
    PENALTY_ON_CL POSITION
    (798-815 ),
    CL_SLB POSITION
    (816-817 ),
    UNTSLB POSITION
    (818-819 ),
    CAPACIT_PENALTY POSITION
    (820-837 ),
    ARREARS_OF_INT POSITION
    (838-855 ),
    INT_ON_ARREARS POSITION
    (856-873 ),
    FIXED_CHARGES POSITION
    (874-891 ),
    ASSESSED_DPC POSITION
    (892-909 ),
    FCA_UNT_OLD POSITION
    (910-927 ),
    FCA_UNT_NEW POSITION
    (928-945 ),
    DEFECT_RDN1 POSITION
    (982-990 ),
    DEFECT_RDN2 POSITION
    (991-999 ),
    CAP_CT_RENT POSITION
    (1000-1008 ),
    CT_RENT POSITION
    (1009-1017 ),
    ADV_BILL_IND POSITION
    (1018-1018 )
    LOCATION
    (EXT_DIR:'rgtr1.txt')
    REJECT
    LIMIT UNLIMITED
    LOGGING
    NOCACHE
    NOPARALLEL;

    KUP-04020: found record longer than buffer size supported, number, in string
    Cause: a record in the data source was longer than the maximum data size supported. The number reported is the maximum supported size of a record.
    Action: none
    Examine your bad file and log files for details of the rows which failed from insertion.

  • ORA-00942 when creating external table under 10g with AQ

    I have an application that runs with AQ. The front-end queues up batch-type
    tasks in a queue. When one particular kind of message is dequeued, it
    initiates a data load. That load requires the creation of an external
    table.
    The schema in question is owned by user BL (bulkload). The queue
    is owned by BLB (bulkload batch), primarily to simplify some of the
    rules needed by the resource manager in order to limit the total CPU
    a batch process can consume. The BLB user has full access to the
    BL schema, along with the following rights:
    CREATE TYPE
    CREATE TABLE
    CREATE SEQUENCE
    CREATE PROCEDURE
    CREATE VIEW
    CREATE SYNONYM
    CREATE SEQUENCE
    ALTER SESSION
    CREATE SESSION
    QUERY REWRITE
    CREATE ANY CONTEXT
    EXECUTE_CATALOG_ROLE
    CREATE MATERIALIZED VIEW
    CREATE ANY DIRECTORY
    DROP ANY DIRECTORY
    The table creation works fine under 9.2.0.8 (our current required
    version). However the application generates an ORA-00942 table or view does
    not exist when run under 10g (10.2.0.1 and 10.2.0.3).
    The following statement is the problem:
    CREATE TABLE bulkload33 (
              field1 VARCHAR2(2000),field2 VARCHAR2(2000),field3 VARCHAR2(2000))
              ORGANIZATION EXTERNAL (
              TYPE oracle_loader DEFAULT DIRECTORY EXT_100
              ACCESS PARAMETERS ( RECORDS DELIMITED BY "\r\n"
              CHARACTERSET 'WE8ISO8859P1'
              BADFILE EXT_100:'bulkload_bad.csv'
              LOGFILE EXT_100:'bulkload_log.csv'
              FIELDS TERMINATED BY ','
              OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS (
              field1 CHAR(2000),field2 CHAR(2000),field3 CHAR(2000),field4 CHAR(2000)))
              LOCATION ('bulkload.csv')
              ) REJECT LIMIT UNLIMITED PARALLEL;
    To clarify, the preceding statement, when handled by the process
    for a queue message, failes with an ORA-00942.
    Note that I can issue the command directly, as BLB or SYS, against
    the BL schema with no problems. Further, as user BLB or SYS, I can do
    the following:
    CREATE OR REPLACE PROCEDURE dotest
    IS
         l_sql varchar2(2000);
    BEGIN
         l_sql := 'CREATE TABLE bulkload33 (
              field1 VARCHAR2(2000),field2 VARCHAR2(2000),field3 VARCHAR2(2000))
              ORGANIZATION EXTERNAL (
              TYPE oracle_loader DEFAULT DIRECTORY EXT_100
              ACCESS PARAMETERS ( RECORDS DELIMITED BY "\r\n"
              CHARACTERSET ''WE8ISO8859P1''
              BADFILE EXT_100:''bulkload_bad.csv''
              LOGFILE EXT_100:''bulkload_log.csv''
              FIELDS TERMINATED BY '',''
              OPTIONALLY ENCLOSED BY ''"'' MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS (
              field1 CHAR(2000),field2 CHAR(2000),field3 CHAR(2000),field4 CHAR(2000)))
              LOCATION (''bulkload.csv'')
              ) REJECT LIMIT UNLIMITED PARALLEL';
         EXECUTE IMMEDIATE l_sql;
    END;
    show errors
    EXEC dotest
    Does anyone have any ideas of why this doesn't work under 10g? Metalink
    has yielded no clues so far.
    Thanks.

    Define "has full access to the BL schema" given that it is impossible to grant access rights, in Oracle, by schema. What was done and how was it done?
    My guess is that the privs were granted in a role, rather than explicitly, as is required for PL/SQL.

Maybe you are looking for

  • FTP Error

    Hi Experts, I am using the below FM CALL FUNCTION 'ZSMQ_SEND_FILE'      EXPORTING        zmqifacena                       = 'ZCAR'       l_parameter_1                    = fname       l_filename                          = ws_dsn       r_parameter_1  

  • I can no longer import photos into 4.2

    Up until a few days ago I could import photos with no issues into LR 4.2. Today I am having big issues. After I select Import Photos and Video from the File menu, the Import screen launches but it is incredibly slow. At first it has only some text an

  • Material Master load in SAP BW

    Hello, I need to load fron SAP ECC Article Characteristics Color and Size. I have created Generic and variant articles by color and size and I want to load in Bi the relation between variant article-size-color. Is there any table in ECC to create a c

  • Use of field type in tables

    Hi ppl, Is there any disadvantage if I create a table with fields for which I don't assign a data element. Instead, I write the Data Type, Length and Short Text manualy ? Eg, I have a field COST_CTR for which I don't assign the field type as KOSTL. I

  • Hi I've got a I phone 5 c how can I put my number for I message instead ov email

    HI I have a I phone5 c how can I put number for I message instead of e mail