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.

Similar Messages

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

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

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

  • Error while loading  data into External table from the flat files

    HI ,
    We have a data load in our project which feeds the oracle external tables with the data from the Flat Files(.bcp files) in unix.
    While loading the data, we are encountering the following error.
    Error occured (Error Code : -29913 and Error Message : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: un) while loading data into table_ext
    Please let us know what needs to be done in this case to solve this problem.
    Thanks,
    Kartheek

    Kartheek,
    I used Google (mine still works).... please check those links:
    http://oraclequirks.blogspot.com/2008/07/ora-29400-data-cartridge-error.html
    http://jonathanlewis.wordpress.com/2011/02/15/ora-29913/
    HTH,
    Thierry

  • Creation of External table by using XML files.

    I am in the process of loading of XML file data into the database table. I want to use the External Table feature for this loading. Though we have the external table feature with Plain/text file, is there any process of XML file data loading into the Database table by using External table?
    I am using Oracle 9i.
    Appreciate your responses.
    Regards
    Edited by: user652422 on Dec 16, 2008 11:00 PM

    Hi,
    The XML file which U posted is working fine and that proved that external table can be created by using xml files.
    Now My problem is that I have xml files which is not as the book.xml, my xml file is having some diff format. below is the extracts of the file ...
    <?xml version="1.0" encoding="UTF-8" ?>
    - <PM-History deviceIP="172.20.7.50">
    <Error Reason="" />
    - <Interface IntfName="otu2-1-10B-3">
    - <TS Type="15-MIN">
    <Error Reason="" />
    - <PM-counters TimeStamp="02/13/2008:12:15">
    <Item Name="BBE-S" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="BBE-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="ES-S" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="ES-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="SES-S" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="SES-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="CSES-S" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="CSES-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="UAS-S" Direction="Received" Validity="ADJ" Value="135" />
    <Item Name="UAS-SFE" Direction="Received" Validity="ADJ" Value="0" />
    <Item Name="SEF-S" Direction="Received" Validity="ADJ" Value="135" />
    </PM-counters>
    <PM-counters TimeStamp="03/26/2008:12:30">
    <Item Name="BBE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="BBE-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="ES" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="ES-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="SES" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="SES-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="CSES" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="CSES-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="UAS" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="UAS-FE" Direction="Received" Validity="OFF" Value="0" />
    <Item Name="PSC" Direction="Received" Validity="OFF" Value="0" />
    </PM-counters>
    </TS>
    </Interface>
    </PM-History>
    My problem is the Item Name and Direction the value of both(ex PSCReceived or UASReceived) will be treated as the coulmn name of the table and '0' would be the value of that column. I am confused how to create the external table creation program for that.
    I would really appreciate your responses.
    Regards

  • Create external table on a CSV file with a variable number of delimiters

    Hi experts,
    I was wondering what the best approach for the following issue.
    I'm trying to create an external table on a file which has in each record (on a new line 'RECORDS DELIMITED BY NEWLINE') a variabel number of delimiters. By example my delimiter is a comma , in the first record I have 100 comma's in the second only 60, the next 80 etc.etc.
    Is there a way to create a external table on this file?
    Thanks in advance.

    alter the source is no option, unfortunalty. But is suggested there would be a sensible workway to handle it. An to solve it I want to pivot i, but first I think I need to have the file in Oracle through a external table.
    Edited by: Jonathan Wisgerhof on Mar 31, 2009 12:21 PM

  • Create multiple external tables from same flat file ?

    using oracle 10g
    currently create many external tables like so..
    CREATE TABLE "XT_UNITS"
    "Q1_2012" VARCHAR2(25 BYTE),
    "Q2_2012" VARCHAR2(25 BYTE),
    "Q3_2012" VARCHAR2(25 BYTE),
    "Q4_2012" VARCHAR2(25 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "XE_FILES" ACCESS PARAMETERS ( records delimited BY newline
    skip 1 fields terminated BY ',' OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES
    ARE NULL ) LOCATION ( 'xtunits.csv' ))
    is there any way I can use 1 flat file (csv) to populate many external tables ?
    maybe by section ?

    Jay wrote:
    using oracle 10g
    currently create many external tables like so..
    CREATE TABLE "XT_UNITS"
    "Q1_2012" VARCHAR2(25 BYTE),
    "Q2_2012" VARCHAR2(25 BYTE),
    "Q3_2012" VARCHAR2(25 BYTE),
    "Q4_2012" VARCHAR2(25 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "XE_FILES" ACCESS PARAMETERS ( records delimited BY newline
    skip 1 fields terminated BY ',' OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES
    ARE NULL ) LOCATION ( 'xtunits.csv' ))
    is there any way I can use 1 flat file (csv) to populate many external tables ?
    maybe by section ?Not a logical question.
    An external table definition relates to one or more files.
    You could probably create multiple externable table definitions to access the same file(s), but you may end up with some operating system file locking issues if you're not careful, and to be honest why would you need to do that?

  • External table log and bad files

    Hi, i have defined the following access parameters for my external table and set REJECT LIMIT to 0:
    ACCESS PARAMETERS
    RECORDS DELIMITED by NEWLINE
    BADFILE BAD_DIR:'CARDS.bad'
    LOGFILE LOG_DIR:'CARDS.log'
    NODISCARDFILE
    FIELDS TERMINATED BY ","
    OPTIONALLY ENCLOSED BY '"'
    READSIZE 1048576
    LRTRIM
    MISSING FIELD VALUES ARE NULL
    REJECT ROWS WITH ALL NULL FIELDS
    I want to know everytime i query the external table, my log file and bad file will be overwritten or appended? i want them to be overwritten.

    Hi,
    Yeah, well, be in for a surprise here:
    "The external tables feature is a complement to existing SQL*Loader functionality."
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/utility.htm#sthref1800
    http://www.oracle.com/pls/db102/search?remark=quick_search&word=external+table&tab_id=&format=ranked
    Have you actually read/tried anything?
    You can download an XE DB for free and play with that.

  • External Table Creation for .dat file

    Hi,
    I have created an External Table, below is the code
    CREATE TABLE  "NFO_DATA_LOAD_STAGING_TEST1"
       (     "DATA_DISCRAPANCY" VARCHAR2(100),
         "APPLICATION_NUMBER" VARCHAR2(30),
         "BATCH_NUMBER" VARCHAR2(30),
         "AMC_ID" VARCHAR2(30),
         "TA_BRANCH" VARCHAR2(30),
         "SERVER_DATE_1" DATE,
         "SERVER_TIME_1" DATE,
         "ARN_NUMBER" VARCHAR2(30),
         "BROKER_CODE" VARCHAR2(30),
         "SUB_BROKER_CODE_1" VARCHAR2(30),
         "SUB_BROKER_CODE_2" VARCHAR2(30),
         "SUB_BROKER_CODE_3" VARCHAR2(30),
         "BROKER_ADDRESS" VARCHAR2(100),
         "FOLIO_NO" NUMBER,
         "MODE_OF_HOLDING" VARCHAR2(30),
         "STATUS" VARCHAR2(30),
         "SALUATION" VARCHAR2(30),
         "CONTACT_PERSON_NAME" VARCHAR2(30),
         "INVESTOR_NAME" VARCHAR2(30),
         "GUARDIAN_NAME" VARCHAR2(30),
         "PAN_NO" VARCHAR2(30),
         "POA_HOLDER_NAME" VARCHAR2(30),
         "KYC" VARCHAR2(30),
         "GUARDIAN_PAN_NO" VARCHAR2(30),
         "DOB_DOC" DATE,
         "GUARDIAN_RELATIONSHIP" VARCHAR2(30),
         "SALUATION_2" VARCHAR2(30),
         "DATE_OF_BIRTH" DATE,
         "SECOND_HOLDER_NAME" VARCHAR2(30),
         "GUARDIAN_NAME_2" VARCHAR2(30),
         "PAN_NO_2" VARCHAR2(30),
         "GUARDIAN_PAN_NO_2" VARCHAR2(30),
         "KYC_2" VARCHAR2(30),
         "GUARDIAN_RELATIONSHIP_2" VARCHAR2(30),
         "SALUATION_3" VARCHAR2(30),
         "DATE_OF_BIRTH_3" DATE,
         "THIRD_HOLDER_NAME" VARCHAR2(30),
         "GUARDIAN_NAME_3" VARCHAR2(30),
         "PAN_NO_3" VARCHAR2(30),
         "GUARDIAN_PAN_NO_3" VARCHAR2(30),
         "KYC_3" VARCHAR2(30),
         "GUARDIAN_RELATIONSHIP_3" VARCHAR2(30),
         "ADDRESS_LINE_1" VARCHAR2(100),
         "PINCODE" NUMBER,
         "ADDRESS_LINE_2" VARCHAR2(100),
         "CONTACT_NUMBER_O" VARCHAR2(15),
         "CITY" VARCHAR2(30),
         "CONTACT_NUMBER_R" VARCHAR2(15),
         "STATE" VARCHAR2(30),
         "MOBILE_NUMBER" VARCHAR2(15),
         "COUNTRY" VARCHAR2(30),
         "EMAIL_ID" VARCHAR2(30),
         "ALT_EMAIL_ID" VARCHAR2(30),
         "ADDRESS_LINE_1_A" VARCHAR2(100),
         "PINCODE_A" NUMBER,
         "ADDRESS_LINE_2_A" VARCHAR2(100),
         "CONTACT_NUMBER_O_A" VARCHAR2(15),
         "CITY_A" VARCHAR2(30),
         "CONTACT_NUMBER_R_A" VARCHAR2(15),
         "STATE_A" VARCHAR2(30),
         "MOBILE_NUMBER_A" VARCHAR2(15),
         "COUNTRY_A" VARCHAR2(30),
         "EMAIL_ID_A" VARCHAR2(30),
         "ALT_EMAIL_ID_A" VARCHAR2(30),
         "DESPATCH_ACCOUNT" VARCHAR2(30),
         "REDEMPTION_PAYOUT" VARCHAR2(30),
         "I_PIN_ASSIGN" VARCHAR2(30),
         "DIVIDEND_PAYOUT" VARCHAR2(30),
         "T_PIN_ASSIGN" VARCHAR2(30),
         "TO_FUND_NAME" VARCHAR2(30),
         "TO_FUND_ID" VARCHAR2(30),
         "OPTION_F_S" VARCHAR2(30),
         "MCR_NO" NUMBER,
         "BANK_NAME" VARCHAR2(30),
         "ACCOUNT_NUMBER" NUMBER,
         "BANK_BRANCH" VARCHAR2(30),
         "ACCOUNT_TYPE" VARCHAR2(30),
         "MCR_NO_P" NUMBER,
         "CHEQUE_DD_NO" NUMBER,
         "BANK_NAME_P" VARCHAR2(30),
         "PAYMENT_DATE" DATE,
         "BANK_BRANCH_P" VARCHAR2(30),
         "ADVICE_NO" NUMBER,
         "PAYMENT_TYPE_P" VARCHAR2(30),
         "AMOUNT_P" NUMBER,
         "MINIMUM_AMOUNT" NUMBER,
         "AMOUNT_WORDS" VARCHAR2(1000),
         "NOMINEE_NAME" VARCHAR2(30),
         "SALUATION_STG" VARCHAR2(30),
         "NOMINEE_DOB_STG" DATE,
         "GUARDIAN_NAME_STG" VARCHAR2(30),
         "RELATIONSHIP_STG" VARCHAR2(30),
         "ADDRESS_LINE_1_STG" VARCHAR2(100),
         "COUNTRY_STG" VARCHAR2(30),
         "ADDRESS_LINE_2_STG" VARCHAR2(100),
         "PINCODE_STG" NUMBER,
         "CITY_STG" VARCHAR2(30),
         "CONTACT_NUMBER_STG" VARCHAR2(15),
         "STATE_STG" VARCHAR2(30),
         "MOBILE_NUMBER_STG" VARCHAR2(15),
         "REMARKS_STG" VARCHAR2(100),
         "EXCEPTION_CHK_STG" CHAR(1),
         "HOLD_CHK_STG" CHAR(1),
         "PAN_STG" CHAR(1),
         "BOARD_RESOLUTION_STG" CHAR(1),
         "KYC_STG" CHAR(1),
         "MOA_STG" CHAR(1),
         "CHEQUE_STG" CHAR(1),
         "ASL_STG" CHAR(1),
         "TRUST_DEED_STG" CHAR(1),
         "PARTNERSHIP_DEED_STG" CHAR(1),
         "BYE_LAWS_STG" CHAR(1),
         "AUTO_DEBIT_STG" CHAR(1),
         "ENROLLMENT_FORM_STG" CHAR(1),
         "APPROVED" VARCHAR2(10),
         "CREATED_BY" NUMBER,
         "CREATION_DATE" DATE,
         "LAST_UPDATE_DATE" DATE,
         "LAST_UPDATED_BY" NUMBER,
         "FUND_TYPE" VARCHAR2(30)
       ORGANIZATION EXTERNAL
        ( TYPE ORACLE_LOADER
          DEFAULT DIRECTORY DUMP_DIR
          ACCESS PARAMETERS
          ( RECORDS DELIMITED BY NEWLINE
               BADFILE 'emp.bad'
                          LOGFILE 't.log_xt'               
                          FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY ' " ' LDTRIM
                          REJECT ROWS WITH ALL NULL FIELDS
                   "DATA_DISCRAPANCY" 
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "APPLICATION_NUMBER"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BATCH_NUMBER"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "AMC_ID"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "TA_BRANCH"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SERVER_DATE_1"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SERVER_TIME_1"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ARN_NUMBER"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BROKER_CODE"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SUB_BROKER_CODE_1"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SUB_BROKER_CODE_2"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SUB_BROKER_CODE_3"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BROKER_ADDRESS"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "FOLIO_NO"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "MODE_OF_HOLDING"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "STATUS"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SALUATION"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CONTACT_PERSON_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "INVESTOR_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PAN_NO"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "POA_HOLDER_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "KYC"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_PAN_NO"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "DOB_DOC"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_RELATIONSHIP"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SALUATION_2"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "DATE_OF_BIRTH"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SECOND_HOLDER_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_NAME_2"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PAN_NO_2"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_PAN_NO_2"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "KYC_2"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_RELATIONSHIP_2"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SALUATION_3"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "DATE_OF_BIRTH_3"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "THIRD_HOLDER_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_NAME_3"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PAN_NO_3"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_PAN_NO_3"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "KYC_3"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_RELATIONSHIP_3"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ADDRESS_LINE_1"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PINCODE"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ADDRESS_LINE_2"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CONTACT_NUMBER_O"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CITY"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CONTACT_NUMBER_R"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "STATE"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "MOBILE_NUMBER"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "COUNTRY"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "EMAIL_ID"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ALT_EMAIL_ID"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ADDRESS_LINE_1_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PINCODE_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ADDRESS_LINE_2_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CONTACT_NUMBER_O_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CITY_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CONTACT_NUMBER_R_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "STATE_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "MOBILE_NUMBER_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "COUNTRY_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "EMAIL_ID_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ALT_EMAIL_ID_A"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "DESPATCH_ACCOUNT"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "REDEMPTION_PAYOUT"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "I_PIN_ASSIGN"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "DIVIDEND_PAYOUT"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "T_PIN_ASSIGN"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "TO_FUND_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "TO_FUND_ID"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "OPTION_F_S"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "MCR_NO"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BANK_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ACCOUNT_NUMBER"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BANK_BRANCH"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ACCOUNT_TYPE"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "MCR_NO_P"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CHEQUE_DD_NO"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BANK_NAME_P"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PAYMENT_DATE"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BANK_BRANCH_P"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ADVICE_NO"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PAYMENT_TYPE_P"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "AMOUNT_P"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "MINIMUM_AMOUNT"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "AMOUNT_WORDS"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "NOMINEE_NAME"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "SALUATION_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "NOMINEE_DOB_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "GUARDIAN_NAME_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "RELATIONSHIP_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ADDRESS_LINE_1_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "COUNTRY_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ADDRESS_LINE_2_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PINCODE_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CITY_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CONTACT_NUMBER_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "STATE_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "MOBILE_NUMBER_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "REMARKS_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "EXCEPTION_CHK_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "HOLD_CHK_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PAN_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BOARD_RESOLUTION_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "KYC_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "MOA_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CHEQUE_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ASL_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "TRUST_DEED_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "PARTNERSHIP_DEED_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "BYE_LAWS_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "AUTO_DEBIT_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "ENROLLMENT_FORM_STG"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "APPROVED"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CREATED_BY"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "CREATION_DATE"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "LAST_UPDATE_DATE"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "LAST_UPDATED_BY"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " ' ,
                   "FUND_TYPE"
                                                             TERMINATED BY ","  OPTIONALLY ENCLOSED BY ' " '
          LOCATION
           ( 'Key_File_Report.dat'
    {code}
    while trying to select the data from external table, am facing the below error.
    {code}
    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: "and, column, exit, (, ltrim, lrtrim, ldrtrim, missing, notrim, rtrim, reject" KUP-01008: the bad identifier was: LDTRIM KUP-01007: at line 4 column 77
    {code}
    can anyone suggest me how to resolve this.
    Regards,
    Sakthi.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

    I think i found the problem:
    KUP-01008: the bad identifier was: LDTRIM KUP-01007: at line 4 column 77There is no LDTRIM. It is LDRTRIM or LRTRIM.
    this should work
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LDRTRIM{code}
    Edited by: Sven W. on Aug 27, 2010 2:59 PM -- removed the blanks in the optionally enclosed spec                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Create an external table based on an XML file

    Hi ,
    I am trying to create an external table based on XML file .Is it possible to do in OWB ?If Yes .Can someone please let me know the same .
    I was successfully able to create an external table based on a flat file which is of the extension *.txt.
    I was even able to load an XML file to a normal
    table .How do we do it to an external table?
    Thanks,
    Manjula

    Hello Manjula,
    Is it possible for you to spare sometime to list down the steps to be followed for creating External Table using flat file *.txt?
    I am trying to do it but not getting through it.
    Thanks in Advance,
    Ripesh

  • Creating external table - from a file with multiple field separators

    I need to create an external table from a flat file containing multiple field separators (",", ";" and "|").
    Is there any way to specifiy this in the CREATE TABLE (external) statement?
    FIELDS TERMINATED BY "," -- Somehow list more than just comma here?
    We receive the file from a vendor every week. I am trying to set up a process for some non-technical users, and I want to keep this process transparent to them and not require them to load the data into Oracle.
    I'd appreciate your help!

    scott@ORA92> CREATE OR REPLACE DIRECTORY my_dir AS 'c:\oracle'
      2  /
    Directory created.
    scott@ORA92> CREATE TABLE external_table
      2    (COL1 NUMBER,
      3       COL2 VARCHAR2(6),
      4       COL3 VARCHAR2(6),
      5       COL4 VARCHAR2(6),
      6       COL5 VARCHAR2(6))
      7  ORGANIZATION external
      8    (TYPE oracle_loader
      9       DEFAULT DIRECTORY my_dir
    10    ACCESS PARAMETERS
    11    (FIELDS
    12         (COL1 CHAR(255)
    13            TERMINATED BY "|",
    14          COL2 CHAR(255)
    15            TERMINATED BY ",",
    16          COL3 CHAR(255)
    17            TERMINATED BY ";",
    18          COL4 CHAR(255)
    19            TERMINATED BY ",",
    20          COL5 CHAR(255)
    21            TERMINATED BY ","))
    22    location ('flat_file.txt'))
    23  /
    Table created.
    scott@ORA92> select * from external_table
      2  /
          COL1 COL2   COL3   COL4   COL5
             1 Field1 Field2 Field3 Field4
             2 Field1 Field2 Field3 Field4
    scott@ORA92>

  • External tables-Fixed length file

    Hi All,
    I have a fixed length file that i load daily using an External table. Recently, one of the field, IP length was changed and customer wants to send both old records with 8 byte length and new records with 11 byte length in the same data file, until complete migration takes place.
    Will it be possible for External tables to handle this requirement?. Or Is there any other possibility to treat it.
    The old file contains 104 fields with IP field position form 490 to 498. Total
    The new file contains 104 fields with the IP position from 490 to 501.
    Thanks,
    Sri.

    If the two record types are mixed in the same file, then you will have problems loading them. I can see two possible solutions, in no particular order of preference (using your example data):
    1. Redefine the external table something like:
    Position (record_type (1:1)
              version     (2:5)
              data        (6:41))then parse the remaining fields based on the version number when you select from the external table.
    2. Create two external tables over the same file, one for version 1.00 and one for version 1.01 using the LOAD WHEN clause to determine which set of data to load when you select. Something like:
    CREATE TABLE version1 ...
    ORGANIZATION EXTERNAL ...
    ACCESS PARAMETERS
    (RECORDS DELIMITED BY newline
      LOAD WHEN (version = 1.00)
    < definition for the old format >
    and
    CREATE TABLE version101 ...
    ORGANIZATION EXTERNAL ...
    ACCESS PARAMETERS
    (RECORDS DELIMITED BY newline
      LOAD WHEN (version = 1.01)
    < definition for the new format >Then yor processing would use something like:
    SELECT ip, last_name
    FROM version1
    UNION ALL
    SELECT ip, last_name
    FROM version101HTH
    John

  • Csv file processing using external table

    Dear All,
    Our database is oracle 10g r2 and OS is solaris
    We  would receive csv files to a particular directory on server each day.
    File Format look like:
    H00,SOURCE_NAME,FILE_CREATED_DATE
    RECORD_TYPE,EMP_ID,EMP_NAME,EMP_DOB(DDMMYYYY),EMP_HIRE_DATE(DDMMYYYY),EMP_LOCATION
    T00,RECORD_COUNT
    EMPLOYEE TABLE STRUCTURE
    EMP_ID                   NOT NULL    NUMBER ,
    EMP_NAME            NOT NULL    VARCHAR2(10) ,
    EMP_DOB                                  DATE,
    EMP_HIRE_DATE   NOT NULL     DATE,
    EMP_LOCATION                VARCHAR2(80)
    Sample File:
    H00,ABC,21092013
    "R01",1,"EMP1","14021986","06072010","LOC1"
    "R01",20000000000,"EMP2","14021-987","06072011",""
    ,***,"EMPPPPPPPPPPP3","14021988","060**012","LOC2"
    "R01",4,4,"14021989","06072013",
    T00,4
    we need to validate each record excluding header and trailer  for:
    DATATYPE, LENGTH,OPTIONALITY, and other date validations such as EMP_HIRE_DATE can not be less than EMP_DOB
    In case of any data errors we need to send a response file for corresponding source file.
    we have  predefined error codes to be sent in the response file.
    ERR001    EMP_ID can not be null
    ERR002    EMP_ID  exceeds 10 digits
    ERR003    EMP_ID is not a number    
    ERR004    EMP_NAME   has to be text
    ERR005    EMP_NAME  length can not exceed 10
    ERR006    EMP_NAME   can not be null
    ERR007    EMP_DOB is not a date
    ERR008    EMP_DOB is not in ddmmyyyy format
    ERR009    EMP_HIRE_DATE is not a date
    ERR010    EMP_HIRE_DATE is not in ddmmyyyy format
    ERR011    EMP_HIRE_DATE can not be null
    ERR012    EMP_LOCATION    has to be text
    ERR013    EMP_LOCATION   length can not exceed 80
    ERR014    EMP_HIRE_DATE can not be less than EMP_DOB
    ERR015    Field missing in the record
    ERR016    More number of fields than allowed
    1.Do I need to create external table before processing each file.(EMP1.txt,EMP2.txt)?
    2.How to generate these error codes in case of respective failure scenarios and to log into an exception table?
    3.response file needs to have entire record and a concatination of all the error codes in the next line.
    4.what would be a better approach among
    creating an external table with all char(2000) fields and writing a select statement
    such as select * from ext_table where (emp id is not null and length(emp_id)<=10 and....to select only proper data);
    or creating the external table to be same as employee table and creating a bad file? if this is the preferred how can I generate the custom error codes?
    Could you please help me in achieving this!
    Warm Regards,
    Shankar.

    You can do a one-time creation of an external table.  After that, you can either overwrite the existing text file or alter the location.  In the example below I have split your original sample file into two files, in order to demonstrate altering the location.  You can make the external table all varchar2 fields as large as they need to be to accommodate all possible data.  If you then create a staging table and rejects table of the same structure, you can create a trigger on the staging table such that, when you insert from the external table to the staging table, it inserts into either the employee table or rejects table with the concatenated error list.  If you want this in a file, then you can just spool a select from the rejects table or use some other method such as utl_file.  The following is a partial example.  Another alternative would be to use SQL*Loader to load directly into the staging table without an external table.
    SCOTT@orcl12c> HOST TYPE emp1.txt
    H00,ABC,21092013
    "R01",1,"EMP1","14021986","06072010","LOC1"
    "R01",20000000000,"EMP2","14021-987","06072011",""
    T00,4
    SCOTT@orcl12c> HOST TYPE emp2.txt
    H00,ABC,21092013
    ,***,"EMPPPPPPPPPPP3","14021988","060**012","LOC2"
    "R01",4,4,"14021989","06072013",
    T00,4
    SCOTT@orcl12c> CREATE OR REPLACE DIRECTORY my_dir AS 'c:\my_oracle_files'
      2  /
    Directory created.
    SCOTT@orcl12c> CREATE TABLE external_table
      2    (record_type       VARCHAR2(10),
      3     emp_id            VARCHAR2(11),
      4     emp_name          VARCHAR2(14),
      5     emp_dob           VARCHAR2(10),
      6     emp_hire_date     VARCHAR2(10),
      7     emp_location      VARCHAR2(80))
      8  ORGANIZATION external
      9    (TYPE oracle_loader
    10     DEFAULT DIRECTORY my_dir
    11     ACCESS PARAMETERS
    12       (RECORDS DELIMITED BY NEWLINE
    13        LOAD WHEN ((1: 3) != "H00" AND (1:3) != 'T00')
    14        LOGFILE 'test.log'
    15        FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' LDRTRIM
    16        MISSING FIELD VALUES ARE NULL
    17        REJECT ROWS WITH ALL NULL FIELDS
    18          (record_type, emp_id, emp_name, emp_dob, emp_hire_date, emp_location))
    19     LOCATION ('emp1.txt'))
    20  /
    Table created.
    SCOTT@orcl12c> CREATE TABLE staging
      2    (record_type       VARCHAR2(10),
      3     emp_id            VARCHAR2(11),
      4     emp_name          VARCHAR2(14),
      5     emp_dob           VARCHAR2(10),
      6     emp_hire_date     VARCHAR2(10),
      7     emp_location      VARCHAR2(80))
      8  /
    Table created.
    SCOTT@orcl12c> CREATE TABLE employee
      2    (emp_id          NUMBER       NOT NULL,
      3     emp_name        VARCHAR2(10) NOT NULL,
      4     emp_dob         DATE,
      5     emp_hire_date   DATE,
      6     emp_location    VARCHAR2(80))
      7  /
    Table created.
    SCOTT@orcl12c> CREATE TABLE rejects
      2    (record_type       VARCHAR2(10),
      3     emp_id            VARCHAR2(11),
      4     emp_name          VARCHAR2(14),
      5     emp_dob           VARCHAR2(10),
      6     emp_hire_date     VARCHAR2(10),
      7     emp_location      VARCHAR2(80),
      8     error_codes       VARCHAR2(4000))
      9  /
    Table created.
    SCOTT@orcl12c> CREATE OR REPLACE TRIGGER staging_air
      2    AFTER INSERT ON staging
      3    FOR EACH ROW
      4  DECLARE
      5    v_rejects         NUMBER := 0;
      6    v_error_codes  VARCHAR2(4000);
      7    v_num          NUMBER;
      8    v_dob          DATE;
      9    v_hire         DATE;
    10  BEGIN
    11    IF :NEW.emp_id IS NULL THEN
    12      v_rejects := v_rejects + 1;
    13      v_error_codes := v_error_codes || ',' || 'ERR001';
    14    ELSIF LENGTH (:NEW.emp_id) > 10 THEN
    15      v_rejects := v_rejects + 1;
    16      v_error_codes := v_error_codes || ',' || 'ERR002';
    17    END IF;
    18    BEGIN
    19      v_num := TO_NUMBER (:NEW.emp_id);
    20    EXCEPTION
    21      WHEN value_error THEN
    22        v_rejects := v_rejects + 1;
    23        v_error_codes := v_error_codes || ',' || 'ERR003';
    24    END;
    25    IF :NEW.emp_name IS NULL THEN
    26      v_rejects := v_rejects + 1;
    27      v_error_codes := v_error_codes || ',' || 'ERR006';
    28    ELSIF LENGTH (:NEW.emp_name) > 10 THEN
    29      v_rejects := v_rejects + 1;
    30      v_error_codes := v_error_codes || ',' || 'ERR005';
    31    END IF;
    32    BEGIN
    33      v_dob := TO_DATE (:NEW.emp_dob, 'ddmmyyyy');
    34    EXCEPTION
    35      WHEN OTHERS THEN
    36        v_rejects := v_rejects + 1;
    37        v_error_codes := v_error_codes || ',' || 'ERR008';
    38    END;
    39    BEGIN
    40      IF :NEW.emp_hire_date IS NULL THEN
    41        v_rejects := v_rejects + 1;
    42        v_error_codes := v_error_codes || ',' || 'ERR011';
    43      ELSE
    44        v_hire := TO_DATE (:NEW.emp_hire_date, 'ddmmyyyy');
    45      END IF;
    46    EXCEPTION
    47      WHEN OTHERS THEN
    48        v_rejects := v_rejects + 1;
    49        v_error_codes := v_error_codes || ',' || 'ERR010';
    50    END;
    51    IF LENGTH (:NEW.emp_location) > 80 THEN
    52      v_rejects := v_rejects + 1;
    53      v_error_codes := v_error_codes || ',' || 'ERR013';
    54    END IF;
    55    IF v_hire IS NOT NULL AND v_dob IS NOT NULL AND v_hire < v_dob THEN
    56        v_rejects := v_rejects + 1;
    57        v_error_codes := v_error_codes || ',' || 'ERR014';
    58    END IF;
    59    IF :NEW.emp_id IS NULL OR :NEW.emp_name IS NULL OR :NEW.emp_dob IS NULL
    60       OR :NEW.emp_hire_date IS NULL OR :NEW.emp_location IS NULL THEN
    61        v_rejects := v_rejects + 1;
    62        v_error_codes := v_error_codes || ',' || 'ERR015';
    63    END IF;
    64    IF v_rejects = 0 THEN
    65      INSERT INTO employee (emp_id, emp_name, emp_dob, emp_hire_date, emp_location)
    66      VALUES (:NEW.emp_id, :NEW.emp_name,
    67              TO_DATE (:NEW.emp_dob, 'ddmmyyyy'), TO_DATE (:NEW.emp_hire_date, 'ddmmyyyy'),
    68              :NEW.emp_location);
    69    ELSE
    70      v_error_codes := LTRIM (v_error_codes, ',');
    71      INSERT INTO rejects
    72        (record_type,
    73         emp_id, emp_name, emp_dob, emp_hire_date, emp_location,
    74         error_codes)
    75      VALUES
    76        (:NEW.record_type,
    77         :NEW.emp_id, :NEW.emp_name, :NEW.emp_dob, :NEW.emp_hire_date, :NEW.emp_location,
    78         v_error_codes);
    79    END IF;
    80  END staging_air;
    81  /
    Trigger created.
    SCOTT@orcl12c> SHOW ERRORS
    No errors.
    SCOTT@orcl12c> INSERT INTO staging SELECT * FROM external_table
      2  /
    2 rows created.
    SCOTT@orcl12c> ALTER TABLE external_table LOCATION ('emp2.txt')
      2  /
    Table altered.
    SCOTT@orcl12c> INSERT INTO staging SELECT * FROM external_table
      2  /
    2 rows created.
    SCOTT@orcl12c> SELECT * FROM employee
      2  /
        EMP_ID EMP_NAME   EMP_DOB         EMP_HIRE_DATE   EMP_LOCATION
             1 EMP1       Fri 14-Feb-1986 Tue 06-Jul-2010 LOC1
    1 row selected.
    SCOTT@orcl12c> COLUMN error_codes NEWLINE
    SCOTT@orcl12c> SELECT * FROM rejects
      2  /
    RECORD_TYP EMP_ID      EMP_NAME       EMP_DOB    EMP_HIRE_D EMP_LOCATION
    ERROR_CODES
    R01        20000000000 EMP2           14021-987  06072011
    ERR002,ERR008,ERR015
               ***         EMPPPPPPPPPPP3 14021988   060**012   LOC2
    ERR003,ERR005,ERR010
    R01        4           4              14021989   06072013
    ERR015
    3 rows selected.

  • Oracle 11g - External Table/Remote File Issue?

    Oracle 11g - External Table/Remote File Issue?
    =============================
    I hope this is the right forum for this issue, if not let me, where to go.
    We are using Oracle 11g (11.2.0.1.0) on (Platform : solaris[tm] oe (64-bit)), Sql Developer 3.0.04
    We are not allowed to put files on the CSV file system (Server A), where DB instance is running. We are able place CSV files on another server(Server B), where DB instance is not running.
    We are trying to use oracle external table to load text files in .CSV format.
    How do we create a Directory (Create Directory) on Server A DB to point to File system of Server B?
    Is it feasible?
    Any idea?
    Thanks in helping.

    The Solaris DBA should be able to mount the filesystem for you. Either that or you have to get creative transferring the file like this;
    http://www.linkedin.com/groups/Getting-creative-external-table-preprocessor-140609.S.50474382?qid=ba673ce4-c4bb-40c5-8367-52bd2a2dfc80&trk=group_search_item_list-0-b-ttl&goback=%2Egmp_140609
    Cheers
    David

  • Can we bind a single external table with multiple files in OWB 11g?

    Hi,
    I wanted to ask if it is possible to bind an external table with multiple source files at same or different locations? Or an external table has to be bound to a single source file and a single location.
    Thanks in advance,
    Ann.
    Edited by: Ann on Oct 8, 2010 9:38 AM

    Hi Ann,
    Can you please help me out by telling me the steps to accomplish this. Right click on the external table in project tree, from the menu choose Configure,
    then in opened Configuration Properties dialog window right clock on Data Files node and choose from menu Create -
    you will get new record for file - specify Data File Name property
    Also link from OWB user guide
    http://download.oracle.com/docs/cd/B28359_01/owb.111/b31278/ref_def_flatfiles.htm#i1126304
    Regards,
    Oleg

  • Can we create single External Table for multiple files?

    HI,
    Can we create External table for multiple files? Could anyone please explain it.
    Thanks and regards
    Gowtham Sen.

    to merge 16 files having same structureWell, if files have the same structure, as per the reading of the example from the following documentation, you can create one external table for all your files :
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14231/tables.htm#i1007480
    Nicolas.

Maybe you are looking for