External table - fetch location ?

Using Oracle 10.2.0.5
An external table is a construct that gives me SQL access to a file.
Is it possible to know the name of the file somehow inside the select? Like Add a column with the file name?
pseudo example
CREATE TABLE EXT_DUMMY
    "RECORDTYPE" VARCHAR2(100 BYTE),
    "COL1" VARCHAR2(100 BYTE),
    "COL2" VARCHAR2(100 BYTE),
    "FILE" VARCHAR2(100 BYTE)
ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "IMPORT_BAD_FILE"
    ACCESS PARAMETERS (
             records delimited BY newline
             FIELDS TERMINATED BY ';'
             MISSING FIELD VALUES ARE NULL
               ( RECORDTYPE CHAR
               , COL1 CHAR
               , COL2 CHAR
               , FILE CHAR FILLER
    LOCATION ( 'Testfile1.txt, Testfile2.txt' )
    reject limit 10
;The result could look like this:
RECORDTYPE   COL1       COL2      FILE
SAMPLE           DUMMY    DUMMY Testfile1.txt
SAMPLE           DUMMY1   DUMMY Testfile1.txt
SAMPLE           DUMMY2   DUMMY Testfile1.txt
SAMPLE           DUMMY3   DUMMY Testfile1.txt
SAMPLE           DUMMY1   DUMMY1 Testfile2.txt
SAMPLE           DUMMY1   DUMMY2 Testfile2.txt
SAMPLE           DUMMY2   DUMMY1 Testfile2.txtI would like to know from which file a certain row is read. Maybe I missed an option in the documentation. In this example I have two different files as the source for the external table.
Another use case could be this:
If I enable a user to switch the external table to a different file alter table EXT_DUMMY location ('Testfile3.txt' ). How can we know which file is read during the select on the table? When userA does the select, maybe userB just altered the location before the select was started. Therefore userA would read in a different file then expected.
Edited by: Sven W. on May 26, 2011 4:48 PM
Edited by: Sven W. on May 26, 2011 4:51 PM
Edited by: Sven W. on May 26, 2011 5:11 PM

Hi Sven,
I'm not sure how much we can rely on this, but let's consider the following :
create table test_xt (
  rec_id  number
, message varchar2(100)
organization external (
  default directory test_dir
  access parameters (
    records delimited by newline
    fields terminated by ';'
  location (
    'marc5.txt'
  , 'test1.csv'
  , 'test2.csv'
  , 'test3.csv'
);I always thought the ROWID doesn't hold much sense for an external table, but...
SQL> select t.rowid
  2       , dump(t.rowid) as rowid_dump
  3       , regexp_substr(dump(t.rowid,10,9,1),'\d+$') as file#
  4       , t.*
  5  from test_xt t
  6  ;
ROWID              ROWID_DUMP                                                FILE#      REC_ID MESSAGE
(AADVyAAAAAAAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,0,0,0,0,0,0,0,0,0     0               1 this is a line from marc5.txt
(AADVyAAAAAAAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,0,0,0,0,0,0,0,0,33    0               2 this is a line from marc5.txt
(AADVyAAAAAAAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,0,0,0,0,0,0,0,0,66    0               3 this is a line from marc5.txt
(AADVyAAAAAAAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,0,0,0,0,0,0,0,0,99    0               4 this is a line from marc5.txt
(AADVyAAAAAEAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,1,0,0,0,0,0,0,0,0     1               1 this is a line from test1.csv
(AADVyAAAAAEAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,1,0,0,0,0,0,0,0,33    1               2 this is a line from test1.csv
(AADVyAAAAAEAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,1,0,0,0,0,0,0,0,66    1               3 this is a line from test1.csv
(AADVyAAAAAEAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,1,0,0,0,0,0,0,0,99    1               4 this is a line from test1.csv
(AADVyAAAAAIAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,2,0,0,0,0,0,0,0,0     2               1 this is a line from test2.csv
(AADVyAAAAAIAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,2,0,0,0,0,0,0,0,33    2               2 this is a line from test2.csv
(AADVyAAAAAIAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,2,0,0,0,0,0,0,0,66    2               3 this is a line from test2.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,0     3               1 this is a line from test3.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,33    3               2 this is a line from test3.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,66    3               3 this is a line from test3.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,99    3               4 this is a line from test3.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,132   3               5 this is a line from test3.csv
16 rows selected
Then with a join to EXTERNAL_LOCATION$ :
SQL> with ext_loc as (
  2    select position-1 as pos
  3         , name as filename
  4    from sys.external_location$
  5    where obj# = ( select object_id
  6                   from user_objects
  7                   where object_name = 'TEST_XT' )
  8  )
  9  select x.filename,
10         t.*
11  from test_xt t
12       join ext_loc x on x.pos = to_number(regexp_substr(dump(t.rowid,10,9,1),'\d+$'))
13  ;
FILENAME       REC_ID MESSAGE
marc5.txt           1 this is a line from marc5.txt
marc5.txt           2 this is a line from marc5.txt
marc5.txt           3 this is a line from marc5.txt
marc5.txt           4 this is a line from marc5.txt
test1.csv           1 this is a line from test1.csv
test1.csv           2 this is a line from test1.csv
test1.csv           3 this is a line from test1.csv
test1.csv           4 this is a line from test1.csv
test2.csv           1 this is a line from test2.csv
test2.csv           2 this is a line from test2.csv
test2.csv           3 this is a line from test2.csv
test3.csv           1 this is a line from test3.csv
test3.csv           2 this is a line from test3.csv
test3.csv           3 this is a line from test3.csv
test3.csv           4 this is a line from test3.csv
test3.csv           5 this is a line from test3.csv
Seems to work... assuming the files are always read in the order specified through the LOCATION parameter, and the generated ROWID actually means what I think it means.

Similar Messages

  • Validate External Table Fails

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

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

  • Error while fetching data from OWB Client using External Table.

    Dear All,
    I am using Oracle Warehouse Builder 11g & Oracle 10gR2 as repository database on Windows 2000 Server.
    I facing some issue in fetching data from a Flat File using external table from OWB Client.
    I have perform all the steps without any error but when I try to view the data, I got the following error.
    ======================================
    RA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file expense_categories.csv in SOURCE_LOCATION not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    java.sql.SQLException: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file expense_categories.csv in SOURCE_LOCATION not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030)
         at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
         at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:774)
         at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:849)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
         at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
         at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:386)
         at oracle.wh.ui.owbcommon.QueryResult.<init>(QueryResult.java:18)
         at oracle.wh.ui.owbcommon.dataviewer.relational.OracleQueryResult.<init>(OracleDVTableModel.java:48)
         at oracle.wh.ui.owbcommon.dataviewer.relational.OracleDVTableModel.doFetch(OracleDVTableModel.java:20)
         at oracle.wh.ui.owbcommon.dataviewer.RDVTableModel.fetch(RDVTableModel.java:46)
         at oracle.wh.ui.owbcommon.dataviewer.BaseDataViewerPanel$1.actionPerformed(BaseDataViewerPanel.java:218)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:282)
         at oracle.wh.ui.owbcommon.dataviewer.BaseDataViewerPanel.executeQuery(BaseDataViewerPanel.java:493)
         at oracle.wh.ui.owbcommon.dataviewer.BaseDataViewerEditor.init(BaseDataViewerEditor.java:116)
         at oracle.wh.ui.owbcommon.dataviewer.BaseDataViewerEditor.<init>(BaseDataViewerEditor.java:58)
         at oracle.wh.ui.owbcommon.dataviewer.relational.DataViewerEditor.<init>(DataViewerEditor.java:16)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at oracle.wh.ui.owbcommon.IdeUtils._tryLaunchEditorByClass(IdeUtils.java:1412)
         at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1349)
         at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1367)
         at oracle.wh.ui.owbcommon.IdeUtils.showDataViewer(IdeUtils.java:869)
         at oracle.wh.ui.owbcommon.IdeUtils.showDataViewer(IdeUtils.java:856)
         at oracle.wh.ui.console.commands.DataViewerCmd.performAction(DataViewerCmd.java:19)
         at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    ===========================
    In the error it is showing that file expense_categories.csv in SOURCE_LOCATION not found but I am 100% sure that file is very much there.
    Is anybody face the same issue?
    Do we need to configure something before loading data from a flat file from OWB Client?
    Any help would higly appreciable.
    Regards,
    Manmohan Sharma

    Hi Detlef / Gowtham,
    Now I am able to fetch data from flat files from OWB Server as well as OWB Client.
    One way I have achieved as suggested by you
    1) Creating location on the OWB Client
    2) Samples the files at client
    3) Created & Configured external table
    4) Copy all flat files on OWB Server
    5) Updated the location which I created at the client.
    Other way
    1) Creating location on the OWB Client
    2) Samples the files at client
    3) Created & Configured external table
    4) Copied flat files on the sever in same drive & directory . like if my all flat files are on C:\data at OWB Client then I copied flat file C:\data on the OWB Server. But this is feasible for Non-Windows.
    Hence my problem solved.
    Thanks a lot.
    Regards,
    Manmohan

  • External table refere to a file in subfolder location

    Hi,
    I'm trying to link a external table to a file in a subfolder in a file location in OWB. Is this possible or do i need to make a new connectior for every folder i want to use for an external file?
    The server is an AIX server. So for example:
    - Location1 is refering to /POS
    But i want to use a file located in /POS/BLA
    regards,
    Osman
    Edited by: Ossy81 on Nov 5, 2009 3:39 PM

    Yes. Here the input from user guide:
    Describing the Flat File Module
    Type a name and an optional description for the flat file module.
    Recall that you create a module for each folder in your file system from which you want to sample existing files or to which you want to create new files. Therefore,
    consider naming the module based on the folder name. Each file module corresponds to one folder in the file system.
    For example, to import flat files from c:\folder1 and a subfolder such as c:\folder1\subfolder,create two file modules such as C_FOLDER1 and C_FODLER1_SUBFOLDER.

  • Error when i fetch the external table in oracle 9i ?

    External table is created.
    But, when i select the external table , it is thrwing the following error.
    I have given READ and WRITE permission to the oracle directory.
    And, i having the flat file with comma delimited data.
    SQL> create table mohan_ext (
    2 EMPNO NUMBER(5) ,
    3 JOB VARCHAR2(15),
    4 SALARY NUMBER(8,2),
    5 MGR NUMBER(5) ,
    6 HIREDATE DATE,
    7 DEPTNO NUMBER(5)
    8 )
    9 organization external
    10 (type oracle_loader
    11 default directory ext_dir
    12 access parameters (records delimited by newline
    13 fields terminated by ','
    14 missing field values are null
    15 (
    16 EMPNO NUMBER(5:5) ,
    17 JOB VARCHAR2(15:15),
    18 SALARY NUMBER(8,2:8,2),
    19 MGR NUMBER(5:5) ,
    20 HIREDATE DATE,
    21 DEPTNO NUMBER(5:5)
    22 )
    23 )
    24 LOCATION('flat.txt'));
    Table created.
    SQL> select * from mohan_ext;
    select * from mohan_ext
    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 "identifier": expecting one of: "comma, char, date, defaultif,
    decimal, double, float, integer, (, nullif, oracle_date, oracle_number, position, raw, recnum, ),
    unsigned, varrawc, varchar, varraw, varcharc, zoned"
    KUP-01008: the bad identifier was: NUMBER
    KUP-01007: at line 5 column 11
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    SQL>

    You may need to scrub some of the data prior to using it as an external table. For instance, ensure that you do not have any extra commas lingering around somewhere within the data as this could cause mapping issues with the data. I've used this process hundreds of times, and more often than not there is an extra comma somewhere that is causing the issue.

  • External table' location

    Database Oracle 11g R2 on Sun
    I have a common structure on a external table, which will be supplied by multiple source files.
    Instead of creating multiple ext table, I have created one and wants to use this one to for all files (FILE NAME is different)
    alter table tbl_nm location ('filename1.dat')
    And I cannot specify all possible file names, because it failed. At one point of time there will be only one file will be available for this external table.
    Is there anyother best practicies for this approach?
    Thanks,

    Well, SOME sort of processing needs to be done to determine what file to point to!
    Another option would be to
    1.) Create an external table for each file
    2.) Create a function which returns a pipelined table type
    3.) In that function test each external table to see which is valid and return that as the pipelined data (or even aggregate several of them through native dynamic SQL if you like)
    4.) Base your mapping on the pipelined function as a source.
    Technically, this should be possible although I've never attempted it.
    Still, I have a question: You say that you do not want to do any external pre-processing, but what control mechanism are you going to use to ensure that one and only one file exists in that directory at any one time, or to indicate that you are done with that file so that it is removed to make way for the next? It seems that some control and interaction needs to be in place for this sort of scenario, so I have to wonder why your design wants to limit leveraging all that these control mechanisms could do to simplify this process.
    Cheers,
    Mike

  • Network location for external table's file

    Hi,
    I am trying to import data from a csv file in oracle 10g database. I can successfully upload data from a csv file located on server itself using external table. But when I redefine directory object on a folder on network location, it doesn't work. Is that a limitation with external tables to access data from a file on network location.
    Any clarifications and suggestions would be highly appreciated.
    Thanks,
    Aniket

    Hi Nicolas,
    I created a directory object pointing to a folder on a system(Other than Oracle 10g server) in the network. This folder is shared and can be accessed from the Oracle 10g server. When I create an external table with the default directory as the shared folder it couldn't read the csv file from that folder ( Shared folder on another system).
    But when I redefined the directory object on a local folder which was on Oracle 10g server, it could read from csv file in the local folder using external table.
    My understanding is using external tables, one can only read files that are on the local machine i.e. Oracle 10g server and not on a different system.
    Please correct me if i am wrong. Any further suggestions would be highly appreciated.
    Regads,
    Aniket

  • Problem in external table

    Hi,
    Oracle Version:10.2.0.1
    Operating system:Linux
    Here i created the external table successfully and when fetching the records for the text file i am getting some problem.
    Here is my external table creation syntax.
    create table sample_ext1 (DETAIL_SEQ_NUM number(15,0),
    REPAY_IDENTIFIER varchar(20),
    REPAY_STATUS varchar(20),
    VISA_CODE VARCHAR2(30),
    NCN_CODE VARCHAR2(10 ),
    AUTH_NUMBER VARCHAR2(10 ),
    EXTENDED_STATUS VARCHAR2(20 )
    organization external
    ( default directory APD_EXTRACTS
      access parameters( RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY 0X'09'
    MISSING FIELD VALUES ARE NULL) location ('sample.txt'));
              and my sample.txt file data is
    1000      james      anderson      51      3      630-033      75188553     
    1001      james      anderson      52      3      630-034      75188554     
    1002      james      anderson      53      3      630-035      75188555     
    1003      james      anderson      54      3      629-959      75188556     
    1004      james      anderson      50      2                75188552     
    1005      james      anderson      55      2                75188557     
    1006      james      anderson      56      2                75188558     
    1007      james      anderson      57      2                75188559     
    1008      james      anderson      58      2                75188560     
    1009      james      anderson      59      2                75188561and the output is
    1000     james      anderson      51      3      630-033      75188553
    1001     james      anderson      52      3      630-034      75188554
    1002     james      anderson      53      3      630-035      75188555
    1003     james      anderson      54      3      629-959      75188556
    1004     james      anderson      50      2           
    1005     james      anderson      55      2           
    1006     james      anderson      56      2           
    1007     james      anderson      57      2           
    1008     james      anderson      58      2           
    1009     james      anderson      59      2           here my problem is in the sixth column i am having some null values in sample.txt file as shown above but in the out put i am getting null values in last column also but there is data .
    Please help me how to solve my problem.
    Thanks & Regards,
    Poorna Prasad.

    Hi All,
    My problem was solved her what i did wrong is at first i made some changer manually to my sample.txt file.But after loading the original fiile as it is with editing it i get the correct output .
    Thanks & Regards,
    Poorna Prasad.

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

  • 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 creating external table

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

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

  • Error while selecting date from external table

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

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

  • Error while querying the external tables in 9i

    i am working on a project on Oracle 9iR2 on Linux AS 3.0, i am in urgent need to port my data in text files for using in the DB
    I have created an external table using the following script. While executing a query it gives the following error. Pls Hlp
    create table ap_info_ex
         (ser_no number(7),
         no_of_sps number(1),
         hpy_liq_mm number(2),
         rmp_rnk_cd number(1),
         ir number(3),
         dps_flg varchar2(1))
    organization external
    (type oracle_loader
         default directory aps_jul
         access parameters (records delimited by newline
                        fields terminated by ","
                        (sno char,
                        no_sps char,
                        hpy_mm char,
                        rmp_rnk char,
                        ir char,
                        dpsflg char))
    location ('info.txt'));
    Table has been created successfully
    but when i execute a query say
    select * from ap_info_ex;
    THIS IS THE ERROR MESSAGE I AM GETTING
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file AP_INFO_EX_6151.log
    OS error Permission denied
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    hope you would help me. i am greateful for that.

    Arun,
    Here are the things you could do.
    1. You may want to specify a logfile in your access parameters using the command 'logfile'.
    For example,
    logfile 'info.log'. You could create the file in advance and provide appropriate permissions to the operating system user(In unix, I use the commands 'touch' and 'chmod').
    2. You could specify the command
    'NOLOGFILE' in your access parameters.
    3. Provide permissions for the user to create files in the folder associated with the directory object 'aps_jul'.

  • How to import external table, which exist in export dump file.

    My export dump file has one external table. While i stated importing into my developement instance , I am getting the error "ORA-00911: invalid character".
    The original definition of the extenal table is as given below
    CREATE TABLE EXT_TABLE_EV02_PRICEMARTDATA
    EGORDERNUMBER VARCHAR2(255 BYTE),
    EGINVOICENUMBER VARCHAR2(255 BYTE),
    EGLINEITEMNUMBER VARCHAR2(255 BYTE),
    EGUID VARCHAR2(255 BYTE),
    EGBRAND VARCHAR2(255 BYTE),
    EGPRODUCTLINE VARCHAR2(255 BYTE),
    EGPRODUCTGROUP VARCHAR2(255 BYTE),
    EGPRODUCTSUBGROUP VARCHAR2(255 BYTE),
    EGMARKETCLASS VARCHAR2(255 BYTE),
    EGSKU VARCHAR2(255 BYTE),
    EGDISCOUNTGROUP VARCHAR2(255 BYTE),
    EGREGION VARCHAR2(255 BYTE),
    EGAREA VARCHAR2(255 BYTE),
    EGSALESREP VARCHAR2(255 BYTE),
    EGDISTRIBUTORCODE VARCHAR2(255 BYTE),
    EGDISTRIBUTOR VARCHAR2(255 BYTE),
    EGECMTIER VARCHAR2(255 BYTE),
    EGECM VARCHAR2(255 BYTE),
    EGSOLATIER VARCHAR2(255 BYTE),
    EGSOLA VARCHAR2(255 BYTE),
    EGTRANSACTIONTYPE VARCHAR2(255 BYTE),
    EGQUOTENUMBER VARCHAR2(255 BYTE),
    EGACCOUNTTYPE VARCHAR2(255 BYTE),
    EGFINANCIALENTITY VARCHAR2(255 BYTE),
    C25 VARCHAR2(255 BYTE),
    EGFINANCIALENTITYCODE VARCHAR2(255 BYTE),
    C27 VARCHAR2(255 BYTE),
    EGBUYINGGROUP VARCHAR2(255 BYTE),
    QTY NUMBER,
    EGTRXDATE DATE,
    EGLISTPRICE NUMBER,
    EGUOM NUMBER,
    EGUNITLISTPRICE NUMBER,
    EGMULTIPLIER NUMBER,
    EGUNITDISCOUNT NUMBER,
    EGCUSTOMERNETPRICE NUMBER,
    EGFREIGHTOUTBOUNDCHARGES NUMBER,
    EGMINIMUMORDERCHARGES NUMBER,
    EGRESTOCKINGCHARGES NUMBER,
    EGINVOICEPRICE NUMBER,
    EGCOMMISSIONS NUMBER,
    EGCASHDISCOUNTS NUMBER,
    EGBUYINGGROUPREBATES NUMBER,
    EGINCENTIVEREBATES NUMBER,
    EGRETURNS NUMBER,
    EGOTHERCREDITS NUMBER,
    EGCOOP NUMBER,
    EGPOCKETPRICE NUMBER,
    EGFREIGHTCOSTS NUMBER,
    EGJOURNALBILLINGCOSTS NUMBER,
    EGMINIMUMORDERCOSTS NUMBER,
    EGORDERENTRYCOSTS NUMBER,
    EGRESTOCKINGCOSTSWAREHOUSE NUMBER,
    EGRETURNSCOSTADMIN NUMBER,
    EGMATERIALCOSTS NUMBER,
    EGLABORCOSTS NUMBER,
    EGOVERHEADCOSTS NUMBER,
    EGPRICEADMINISTRATIONCOSTS NUMBER,
    EGSHORTPAYMENTCOSTS NUMBER,
    EGTERMCOSTS NUMBER,
    EGPOCKETMARGIN NUMBER,
    EGPOCKETMARGINGP NUMBER,
    EGWEIGHTEDAVEMULTIPLIER NUMBER
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY EV02_PRICEMARTDATA_CSV_CON
    ACCESS PARAMETERS
    LOCATION (EV02_PRICEMARTDATA_CSV_CON:'VPA.csv')
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    NOMONITORING;
    While importing , when i seen the log file , it is failing the create the external table. Getting the error "ORA-00911: invalid character".
    Can some one suggest how to import external tables
    Addressing this issue will be highly appriciated.
    Naveen

    Hi Srinath,
    When i observed the create table syntax of external table from import dump log file, it show few lines as below. I could not understand these special characters. And create table definationis failing with special character viz ORA-00911: invalid character
    ACCESS PARAMETERS
    LOCATION (EV02_PRICEMARTDATA_CSV_CON:'VPA.csv').
    I even observed the create table DDL from TOAD. It is same as i mentioned earlier
    Naveen

  • How to get the bound object of an external table with OMB

    Hello,
    I try to find it but without success. So may be one of you, know this secret information.
    I want to synchronize with the help of an OMB script my external tables.
    OMBSYNCHRONIZE FLAT_FILE '/MY_PROJECT/MY_FLAT_FILE_MODULE/MY_FLAT_FILE' RECORD 'MY_RECORD' TO EXTERNAL_TABLE 'MY_EXTERNAL_TABLE' \
    USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_ID')For this purpose, I need to know the bound object. When you synchronize with the help of the GUI, you see it easily.
    Example:
    /MY_PROJECT/MY_FLAT_FILE_MODULE/MY_FLAT_FILE/MY_RECORDI searched in the properties of the external table and I don't see a BOUND OBJECT property.
    OMBDESCRIBE CLASS_DEFINITION 'EXTERNAL_TABLE' GET PROPERTY_DEFINITIONS
    BAD_FILE_LOCATION BAD_FILE_NAME BUSINESS_NAME DATA_FILES DEPLOYABLE DESCRIPTION
    DISCARD_FILE_LOCATION DISCARD_FILE_NAME ENDIAN GENERATE_ERROR_TABLE_ONLY GENERAT
    ION_COMMENTS LOAD_NULLS_WHEN_MISSING_VALUES LOG_FILE_LOCATION LOG_FILE_NAME NLS_
    CHARACTERSET NUMBER_OF_REJECTS_ALLOWED PARALLEL_ACCESS_DRIVERS PARALLEL_ACCESS_M
    ODE REJECTS_ARE_UNLIMITED SHADOW_TABLESPACE SHADOW_TABLE_NAME STRING_SIZES_IN TR
    IM UOIDThen I try the BOUND_OBJECT cached properties of a mapping operator but no luck.
    OMBRETRIEVE EXTERNAL_TABLE 'MY_EXTERNAL_TABLE' GET BOUND_OBJECT
    OMB00001: Encountered BOUND_OBJECT at line: 1, column: 56. Was expecting one of:
    "PROPERTIES" ...
        "REF" ...
        "REFERENCE" ...
        "COLUMN" ...
        "DEFAULT_LOCATION" ...
        "FLAT_FILE" ...
        "RECORD" ...
        "COLUMNS" ...
        "DATA_FILES" ...
        "DATA_RULE_USAGES" ...I have already the file and the record with the FLAT_FILE and RECORD properties
    OMBRETRIEVE EXTERNAL_TABLE  'MY_EXTERNAL_TABLE'  GET FLAT_FILE
    OMBRETRIEVE EXTERNAL_TABLE  'MY_EXTERNAL_TABLE'  GET RECORDBut how can I get the flat file module:
    MY_FLAT_FILE_MODULEDoes anybody know how OWB retrieve this information ?
    Thanks in advance and good day
    Nico
    Edited by: gerardnico on Jan 13, 2010 12:08 PM
    Change get the location by get the flat_file_module

    Yes, Oleg. It's what's worried me.
    The BOUND_OBJECT property of a table operator is not in the API.
    OMBDESCRIBE CLASS_DEFINITION 'TABLE_OPERATOR' GET PROPERTY_DEFINITIONS
    ADVANCED_MATCH_BY_CONSTRAINT AUTOMATIC_HINTS_ENABLED BOUND_NAME BUSINESS_NAME CO
    NFLICT_RESOLUTION DATABASE_FILE_NAME DATABASE_LINK DATA_COLLECTION_FREQUENCY DAT
    A_RULES DB_LOCATION DEBUG_BOUND_NAME DEBUG_DB_LOCATION DESCRIPTION DIRECT ENABLE
    _CONSTRAINTS ERROR_SELECT_FILTER ERROR_SELECT_ROLL_UP ERROR_TABLE_NAME EVALUATE_
    CHECK_CONSTRAINTS EXCEPTIONS_TABLE_NAME EXTRACTION_HINT IS_TEMP_STAGE_TABLE JOIN
    RANK KEYS_READONLY LOADING_HINT LOADING_TYPE MATCH_BY_CONSTRAINT OPTIMIZE_MERGE
    PARTITION_NAME PEL_ENABLED PRIMARY_SOURCE RECORDS_TO_SKIP REPLACE_DATA ROW_COUNT
    ROW_COUNT_ENABLED SCHEMA SINGLEROW SORTED_INDEXES_CLAUSE SUBPARTITION_NAME TARG
    ET_FILTER_FOR_DELETE TARGET_FILTER_FOR_UPDATE TARGET_LOAD_ORDER TEMP_STAGE_TABLE
    _EXTRA_DDL_CLAUSES TEST_DATA_COLUMN_LIST TEST_DATA_WHERE_CLAUSE TRAILING_NULLCOL
    S TRUNCATE_ERROR_TABLE UOID USE_LCR_APIThen I was wondering if anyone knew a little bit the same hidden property but to get the flat file source object of an external table.
    Cheers
    Nico

Maybe you are looking for

  • The Origin of Random iChat video failu

    I hope this topic gets a lot of response and reply from as many people as we can get involved. If you are like me you have been using iChat more of less happily for some months and then suddenly all **** breaks loose and you cannot initiate chats wit

  • Use illustrator CS6 Windows in a  Mac ? I've got a pc and want to work on an imac, but is there no way to use my softwares adobe windows ?

    Hi. All is in the title. If anyone could answer me. I've got a licence illustrator CS6 windows,  and It would sound me incredible, not to be possible use it on mac. Thanks a lot. Aurélien

  • Discounts Report

    Is there a report to see discounts taken or lost from vendors in sap and also the same report for discounts given to customers?

  • Card Security code is invalid? ...

    Sometimes my credit card works, sometimes it doesnt. At this moment, Itunes is saying my card security code is invalid... I cant buy anything else and I cant upgrade my old apps, even the free ones. Its not the first time Im having this problem...

  • OS X update installation failure problem

    MacBook Pro 7,1 core duo 2,66GHz (2010) Mac Os X 10.6.3 The Macbook fell down and the LCD screen is broken. If I run the hardware test, it fails. However, when attached to an external monitor seems to work fine. So this is the way I'm using it right