External Table Problem

Hi Guys,
Need your help regarding external tables, I'm using Oracle 10g. I have tried using external tables and almost all of them works except for one. It has a null data on the last field.
Kindly check what am I missing.
CREATE TABLE X_MHC_FCSDOC2PROV_02
DOCTOR_ID VARCHAR2(100 BYTE),
PROVIDER_ID VARCHAR2(100 BYTE),
JOIN_DATE VARCHAR2(100 BYTE),
EXIT_DATE VARCHAR2(100 BYTE),
ROOM_NUMBER VARCHAR2(100 BYTE),
AGREEMENT_NUMBER VARCHAR2(100 BYTE),
CP1_NAME VARCHAR2(100 BYTE),
CP1_BUSINESS_TEL VARCHAR2(100 BYTE),
CLINIC_HOUR_MON VARCHAR2(100 BYTE),
CLINIC_HOUR_TUE VARCHAR2(100 BYTE),
CLINIC_HOUR_WED VARCHAR2(100 BYTE),
CLINIC_HOUR_THU VARCHAR2(100 BYTE),
CLINIC_HOUR_FRI VARCHAR2(100 BYTE),
CLINIC_HOUR_SAT VARCHAR2(100 BYTE),
CLINIC_HOUR_SUN VARCHAR2(100 BYTE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY MEDILINK_DATA
ACCESS PARAMETERS
     records delimited by "\n"
     fields missing field values are null
badfile medilink_data_log:'X_MHC_FCSDOC2PROV_02.bad'
LOGFILE medilink_data_log:'X_MHC_FCSDOC2PROV_02.log'
discardfile medilink_data_log:'X_MHC_FCSDOC2PROV_02.dsc'
fields terminated BY '|'
reject ROWS WITH ALL NULL fields
LOCATION (MEDILINK_DATA:'medlnk-docToProv.txt')
REJECT LIMIT UNLIMITED
select * from x_mhc_fcsdoc2prov_02
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 "badfile": expecting one of: "column, exit, (, reject"
KUP-01007: at line 3 column 1
ORA-06512: at "SYS.ORACLE_LOADER", line 19
Here is sample of the data.
medlnk-docToProv.txt
DR026556|HO008051|11/29/2006 0:0:0|12/31/9999 0:0:0||10095|ANICETA R FUENTENEGRA |2552821|||||||
DR026556|HO001322|11/29/2006 0:0:0|12/31/9999 0:0:0||10095|ANECITA FUENTENEGRA |2341520|1400 - 1730|1400 - 1730|1400 - 1730||1400 - 1730||
* The last field is null
Your help is very much appreciated. I've been researching for days now on how to resolve this issue but still I can't figure it out.
Thanks.
Best Regards,
Earl Del Rosario

There was syntax problem.
Try this
CREATE TABLE X_MHC_FCSDOC2PROV_02
DOCTOR_ID VARCHAR2(100 BYTE),
PROVIDER_ID VARCHAR2(100 BYTE),
JOIN_DATE VARCHAR2(100 BYTE),
EXIT_DATE VARCHAR2(100 BYTE),
ROOM_NUMBER VARCHAR2(100 BYTE),
AGREEMENT_NUMBER VARCHAR2(100 BYTE),
CP1_NAME VARCHAR2(100 BYTE),
CP1_BUSINESS_TEL VARCHAR2(100 BYTE),
CLINIC_HOUR_MON VARCHAR2(100 BYTE),
CLINIC_HOUR_TUE VARCHAR2(100 BYTE),
CLINIC_HOUR_WED VARCHAR2(100 BYTE),
CLINIC_HOUR_THU VARCHAR2(100 BYTE),
CLINIC_HOUR_FRI VARCHAR2(100 BYTE),
CLINIC_HOUR_SAT VARCHAR2(100 BYTE),
CLINIC_HOUR_SUN VARCHAR2(100 BYTE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY EXT_DIR
ACCESS PARAMETERS
RECORDS DELIMITED BY NEWLINE
badfile EXT_DIR:'X_MHC_FCSDOC2PROV_02.bad'
LOGFILE EXT_DIR:'X_MHC_FCSDOC2PROV_02.log'
discardfile EXT_DIR:'X_MHC_FCSDOC2PROV_02.dsc'
FIELDS TERMINATED BY '|'
MISSING FIELD VALUES ARE NULL
reject ROWS WITH ALL NULL fields )
LOCATION (EXT_DIR:'medlnk-docToProv.txt')
REJECT LIMIT UNLIMITED
Details of directory object EXT_DIR is as belows
SQL> SElect * from all_directories where directory_name = 'EXT_DIR';
OWNER DIRECTORY_NAME
DIRECTORY_PATH
SYS EXT_DIR
c:\

Similar Messages

  • External Table Problem - Need Urgent Help

    Hi All,
    I want to load flat file data to oracle database.
    I have used external table feautre for loading data.
    My data is like
    "F","1","1","KIAWAH ISLAND rated off the pace, rallied to gain command on the far turn, then"
    Now my problem is that fields are terminated with comma but there is a comma inbetween field values. please see last field value (i.e ", then" that is value of third field).
    Now what access parameter should specify to create external table that maps to this type of data. I have used fields terminated by "," and Enclosed by '"' and '"".
    but it still gives me error.
    So, Please help urgently

    Could you post your controlfile?

  • EXTERNAL TABLE PROBLEM ;;;PLS HELP ME

    Hi all,
    I have a problem with the external tables; I have an external table object as follows:
    CREATE TABLE "ESD"."REF_TMP"
    ( "DATEPUB" VARCHAR2(50),
    "ADNETWORK" VARCHAR2(200),
    "SECTION" VARCHAR2(200),
    "CU" VARCHAR2(50),
    "CER" VARCHAR2(200),
    "KW" VARCHAR2(50),
    "CAMPAIGN" VARCHAR2(200),
    "PLACEMENT" VARCHAR2(200),
    "CREA" VARCHAR2(200),
    "CREAU" VARCHAR2(4000),
    "URL" VARCHAR2(4000),
    "IMP" VARCHAR2(50),
    "CLK" VARCHAR2(50),
    "COST" VARCHAR2(50),
    "NUM" VARCHAR2(200),
    "CAMPAIGNID" VARCHAR2(50),
    "LOGIN_STR" VARCHAR2(4000),
    "POST_IMPS" VARCHAR2(50),
    "POST_CLICKS" VARCHAR2(50)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY "REF_DIR"
    ACCESS PARAMETERS
    ( records delimited by newline SKIP 0 badfile ref_dir:'ref_bad.bad' logfile ref_dir:'ref_log.log' fields terminated by ",," missing field values are null ( DATEPUB, ADNETWORK, SECTION, CU, CER, KW, CAMPAIGN, PLACEMENT, CREA, CREAU, URL, IMP, CLK, COST, NUM, CAMPAIGNID, LOGIN_STR, POST_IMPS, POST_CLICKS) )
    LOCATION
    ( 'ref_20061114.csv'
    REJECT LIMIT UNLIMITED
    I have created it on two different Oracle databases; these two bases have the same version so "Oracle Database 10g Enterprise Edition Release 10.2.0.1.0", the object links on the same CSV file...
    The problem is when I select the object from the database I obtain different results (on the first database all the records‘re number’s type) and on the other database I obtain some records from precedent row so the result is shifted. Can someone tell me please the origin of the problem!!!
    Thanks,
    Message was edited by:
    HAGGAR

    20061114,,Ratpromo,,BD eW fp,,1325,,HTML BD WW,,KW,,eer,,lp bd ve clean,,He de,,http://RREREpass.net/?id=6,,http://ddd.net/?id=6,,1,,0,,0,,FBNDerAUt,,44931,,login=57287,,0,,0                                                                 
    20061114,,Ratpromo,,BD Kz fp,,1325,, HTML Bz WW,,KW,,REFbd,,lp bd yu clean,,Totaly uncensored,,http://access.razd-pass.net/?id=101,,http://z-pass.net/?id=101,,1,,0,,0,,FBNEzBAUt,,4932,,login=672225,,0,,0                                                                 
    20061114,,Ratpromo,,BD zW fp,,1325,,zHTML BD WW,,KW,,EG bd z,,lp bd cz clean,,NCC Liveshow babes,,http://e-pass.net/?id=601,,http://e-pass.net/?id=601,,1,,0,,0,,FBMZNO8AUt,,4923,,login=672125,,0,,0                                                                 
    20061114,,Ratpromo,,HD GEdPdOP,,1385,,HDSA CO,,E,,Softdprdfit,,SdP DEFZULT WW,,Winantispyware US,,http://dwindware.com/NjM1/2/422,,http://go.widtidywdre.com/NjM1/2/422,,0,,1,,0,,FBJQe0kAVp,,4688,,login=673125,,0,,0

  • Problem while selecting data from external tables

    Hi All,
    I am facing a problem with external tabels. I have created an external table
    create table ext_org_table
    ( id varchar2(10)
    , name varchar2(100)
    ,id_parent varchar2(10)
    ,name_parent varchar2(100))
    organization external
    ( type oracle_loader
    default directory MYDIR
    access parameters
    records delimited by newline
         nologfile
         nobadfile
    fields terminated by ','
    missing field values are null
    location ('Orgdata.csv')
    reject limit unlimited;
    The problem is that when i give select * from ext_org_table , i get following error
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file Orgdata.csv in MYDIR not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    ORA-06512: at line 1
    Now , i have file Orgdata.csv in the specified directory.
    I have created directory in oracle using create directory command.
    I have granted read,write permission on the directory to user.
    I have given all read,write and execute permissions to folder where my files resides.My file resides in /appl/home/kk
    Now i don't understand why it is giving error file in Mydir not found.
    Kindly suggest.
    Regards
    Krish

    Hi,
    You are obviously doing someting wrong.
    May be the direcotry is not present or may be the file is not rpesent in the directory.
    I just tried ths
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    Connected as SYS
    create directory mydir as 'c:\csv';
    grant read,write on directory mydir to scott;From Scott
    create table ext_org_table
    ( id varchar2(10)
    , name varchar2(100)
    ,id_parent varchar2(10)
    ,name_parent varchar2(100))
    organization external
    ( type oracle_loader
    default directory MYDIR
    access parameters
    records delimited by newline
    nologfile
    nobadfile
    fields terminated by ','
    missing field values are null
    location ('Orgdata.csv')
    reject limit unlimited;
    select * from ext_org_table;Ofcourse i made up some dummy data to test and its all OK.
    again,
    You may want to check if
    1) If the directory exists (select * from all_directories where directory_name='MYDIR');
    2) If the user has the read/write permissions on that directory
    3) If the file orgdata exists in that directory.
    Regards,
    Bhushan

  • Synonym problem with external table in materialized view

    I have a materialized view that includes selects on two external tables.
    However, no matter how I try to access the external tables, the creation fails with a "Synonym Translation Is No Longer Valid" (ORA-00980) error.
    This happens even when I replace the tablename with the full table name, including the link.
    I can create a view just fine, but if I then try something like CREATE MATERIALIZED VIEW mvw_my_view AS SELECT * FROM vw_my_view (where vw_my_view is the view in question), it still throws the Synonym Translation exception.

    00980, 00000, "synonym translation is no longer valid"
    // *Cause: A synonym did not translate to a legal target object. This
    //         could happen for one of the following reasons:
    //         1. The target schema does not exist.
    //         2. The target object does not exist.
    //         3. The synonym specifies an incorrect database link.
    //         4. The synonym is not versioned but specifies a versioned
    //            target object.
    // *Action: Change the synonym definition so that the synonym points at
    //          a legal target object.It is really, Really, REALLY difficult to fix a problem that can not be seen.
    use COPY & PASTE so we can see what you do & how Oracle responds.

  • External table in Oracle 10g and Windows server 2003 problem

    I'm having a problem accessing an external table in an Oracle 10g and Windows 2003 server environment. The disk is remote (mapped) to the server. It's the usual access errors, kup-04001 or kup-04063.
    I have the [seemingly] exact same setup in an Oracle 9i and Windows 2000 server environment which works perfectly. Services run as local SYSTEM and SYSTEM has full permissions on the disk. Directories exist and so do the permissions to the directories.
    In the Oracle 10g and Windows 2003 environment, services run as local SYSTEM and SYSTEM has full permissions on the mapped disk. Directories exist and so do the permissions to the directories.
    This obviously effects mappings, deployments, etc.
    Does anyone know if something changed in either the db or the os?
    Thank you,
    Michael

    Thank you for your reply.
    Your proposal is the standard solution. As a matter of fact, that's how it is on my "old" system. Server "A" Oracle services are started by SYSTEM. Server "B" Oracle services are started by SYSTEM and is where the flat files reside. SYSTEM has full permissions on a disk local to Server "B". Database directoriies defined on Server "A" point to Server "B" remote disk. External Tables on Server "A" are defined with directories that point to Server "B" remote (mapped) disk. I have no problems with this configuration.
    I'm having a problem acheiving the same configuration with Oracle 10g and Windows 2003. I guess I'm baffled over the fact it isn't working the same way as my "old" environment. Why shouldn't it? Oracle (and you) want me to start services as a specific user. It shouldn't have to be that way unless something changed in the way the database makes calls to the os or if Microsoft slipped something in with one of it's numerous security patches.

  • Unix permission problem for external table in oracle 10g, sun solaris

    Hello All,
    I'm facing a problem in accessing external table which has stumped me a bit.
    What I'm looking for is to use a external table with restricted permission to Others(770) on unix.
    Would appreciate if someone helps me out here.
    Here are the steps:
    1.create directory ext_tab_dir1 as '/home/ravi/test'
    2.grant read,write on directory ext_tab_dir1 to scott
    3.CREATE TABLE scott.emp_load1(employee_number CHAR(5))
    ORGANIZATION EXTERNAL (
    type oracle_loader
    default directory ext_tab_dir1
    access parameters (
    records delimited by newline
    fields terminated by ' '
    optionally enclosed by '"'
    missing field values are null
    location ('info.dat')
    Now I have added unix user oracle to unix group myDbGroup and provided myDbGroup read/write/exec permission on directory /home/ravi/test.
    info.dat has been placed in /home/ravi/test.
    #pwd
    /home/ravi
    #ls -l
    drwxrwx--- 2 ravi myDbGroup 512 Mar 7 17:35 test
    I have manually logged in as user oracle and successfully created a sample file in /home/ravi/test.
    -rwxrwx--- 1 ravi myDbGroup 13 Mar 7 17:33 info.dat
    -rw-r--r-- 1 oracle oinstall 0 Mar 7 18:05 sampleFile
    I then connect to the db using sqlplus as ravi and do a
    #select * from scott.emp_load1
    I get the following error
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file emp_load1_18567.log
    OS error Permission denied
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    After this, I gave full permission to /home/ravi/test
    drwxrwxrwx 2 ravi myDbGroup 512 Mar 7 17:35 test
    #select * from scott.emp_load1
    And this was successful.
    It created a log file in /home/ravi/test
    -rwxrwx--- 1 ravi myDbGroup 13 Mar 7 17:33 info.dat
    -rw-r--r-- 1 oracle oinstall 0 Mar 7 18:05 sampleFile
    -rw-r--r-- 1 oracle oinstall 0 Mar 7 18:05 emp_load1_18567.log
    Now what stumped me is the owner and group owner of the file emp_load1_18567.log.
    It is same as the sampleFile which I created manually!!
    From this it can be deducted oracle is not using user id oracle while reading/writing to the unix directory but somehow assigning user id oracle as owner to the log file at the end.
    If someone has encountered this problem earlier or has some info about this...pls share.
    Regards,
    Ravinandan

    Thanks for the reply.
    I have earlier checked this with NOLOGFILE option.
    But no luck.
    I would like to add one more detail(which I missed earlier) about the problem.
    If I give 750 access to /home/ravi(That is read/exec to Group and none perm to Others),
    I will get the same error(KUP-04063: unable to open log file emp_load1_18567.log).
    This obviously means oracle is not even able to access the directory(Although unix user oracle has access via the group perms).

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

  • Problem with a character in an external table

    I have Unix Sun OS 5.8
    I received 1 file with data. The problem is that this file has a character ' ' in the end file then the charge has an error. The character in the end file is in hexadecimal: 0A, 1A.
    Then I have an External table and I put the the clause LOAD WHEN (COMARC != ' ') but when I edit the external table I see LOAD WHEN (COMARC != '.').
    And the last record with the ' ' character doesn’t filter.
    Note: the character isn't a space ' '. It is the hexadecimal: 0A, 1A
    What I have to put in the LOAD WHEN (COMARC != '??????????') to filter this character?

    I put LOAD WHEN (COMARC != x'0A1A') but I receive the error:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "single-quoted-string": expecting one of: "and, not, or, )"
    KUP-01007: at line 3 column 26
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    If I put:
    LOAD WHEN (COMARC != ' ') for example I don't received any error!
    What happens?
    Thanks!

  • Oracle External Table SELECT FROM problem from workstation

    At Solaris Oracle database server console.
    Created directory on the Solaris server as Oracle owner.
    As SYS created oracle directory object on that Solaris directory
    Granted read/write to SCHEMA_OWNER on that oracle directory object.
    Using OS Oracle user, moved a tab-delimited flat file into the Solaris directory.
    Logged on a SCHEMA_OWNER using SQLPLUS on the Solaris database server.
    Ran external table script in SQLPLUS.
    External table was created.
    Ran Select * from ext_table.
    Appropriate dataset returned.
    So at the Oracle Solaris server console,
    the create external table script worked without errors,
    and a select from statement on the external table worked without errors.
    Move to developer workstation:
    Logged on as SCHEMA_OWNER using SQLPLUS on Windows workstation.
    TNSNAMES of course points to the Solaris database server.
    Ran the external table script in SQLPLUS.
    External table was created.
    Ran Select * from ext_table.
    This failed with these errors:
    ORA29913 error executing ODCIEXTTABLEOPEN callout
    ORA29400 data cartridge error
    cant open logfile.log
    OS permission denied
    ORA06512 sys.oracle_loader line 19
    So how can I select from external tables from a windows workstation?
    Any guidance on this problem would be appreciated.

    Thank you for your response.
    I am not creating the external table on the workstation.
    In both cases,
    from the Solaris console
    and from the Windows workstation
    the external table is being created on the Solaris file system
    in an Oracle Directory object
    running an SQL script from SQLPLUS prompt.
    The external table creator, schema owner, has read and write permissions
    granted by SYS on the oracle directory object.
    The problem is:
    Logged in as the schema owner,
    you can select * from ext_table from the Solaris console SQLPLUS,
    but you can not select * from ext_table from the Windows workstation SQLPLUS.
    You can DROP TABLE ext_table from the Windows workstation SQLPLUS.
    You just cannot select * from ext_table from the Windows workstation SQLPLUS.
    I guess as a test,
    I can drop from the ext_table creation script the references
    to discardfile, badfile, and logfile,
    and remove this other file objects from the equation...
    which appears to be a file permissions problem.

  • Problem with file used by external table

    Hi all,
    following situation:
    I am creating my file on unix/solaris and ftp it to oracle server which is running on windows.
    I am getting following error when I try to do select on the external table I get:
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-29400: data cartridge error
    KUP-04020: found record longer than buffer size supported, 524288, in D:\corona\flat_files\input\CORE.PROGRESS.TXT
    ORA-06512: at "SYS.ORACLE_LOADER", line 52
    But it is working when I do following:
    File->Conversions->UNIX/MAC to DOS-> Save it and ftp to windows server.
    I have already tried to call unix2dos in my shell script, but I keep getting the same error.
    Here is the CREATE TABLE:
    CREATE TABLE EXT_TRACKING_DATA_PROGRESS
    TRACKING_ID VARCHAR2(19 BYTE),
    COMPANY_ID VARCHAR2(19 BYTE),
    SUPPLIER_ID VARCHAR2(1 BYTE),
    TRACKING_ID_TYPE VARCHAR2(2 BYTE),
    START_DATE VARCHAR2(10 BYTE),
    END_DATE VARCHAR2(10 BYTE),
    BLANK VARCHAR2(100 BYTE)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY DIR_INPUT
    ACCESS PARAMETERS
    ( fields terminated BY '@|@' )
    LOCATION (DIR_INPUT:'CORE.PROGRESS.TXT')
    REJECT LIMIT 0
    NOPARALLEL
    NOMONITORING;

    Are you FTP-ing the file to the Windows machine in ASCII mode? Or in binary mode? Binary mode won't convert the line breaks from Unix to Windows, which would appear to be the problem.
    Justin

  • Weird problem using external tables

    Hi,
    Please move my message to the correct forum if it is not in the right one.
    Problem:
    I have the following external table definition:
    CREATE TABLE blabla (
         AANSLUITINGSNR_BV NUMBER(15),
         BSN_NR               NUMBER(9),
         DATUM_AANVANG_UKV          DATE,     
         DATUM_EIND_UKV               DATE,
         BEDR_WAO_WERKN_REFJ          number(18),
         BEDR_WAO_WERKG_REFJ          NUMBER(38)                              
    ORGANIZATION EXTERNAL (
    TYPE oracle_loader
    DEFAULT DIRECTORY nood_dir
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ';'
    MISSING FIELD VALUES ARE NULL
         "AANSLUITINGSNR_BV",
         "BSN_NR",           
         "DATUM_AANVANG_UKV"      DATE "YYYYMMDD",
         "DATUM_EIND_UKV"          DATE "YYYYMMDD",
         "BEDR_WAO_WERKN_REFJ",
         "BEDR_WAO_WERKG_REFJ"
    LOCATION ('myfile.csv')
    REJECT LIMIT UNLIMITED;
    My file looks like this:
    107031035423278;913487654;20010101;20011231;3231729003;8334195582
    128039008378982;117347347;20010101;20011231;1606131689;4468506457
    134740829467773;450263934;20010101;20011231;9568986434;526201096
    141020256280899;782714783;20010101;20011231;33235678;2398903683
    146130347251892;960256796;20010101;20011231;441706397;2622754437
    151020336151123;441010528;20010101;20011231;8183416412;6077359802
    152888977527618;114572066;20010101;20011231;2370992895;6196483262
    But when selecting the following log is stated:
    error processing column BEDR_WAO_WERKG_REFJ in row 1 for datafile /oracle/db/noodscenario/myfile.csv
    ORA-01722: invalid number
    error processing column BEDR_WAO_WERKG_REFJ in row 2 for datafile /oracle/db/noodscenario/myfile.csv
    ORA-01722: invalid number
    Why is number 8334195582 stated as invalid ?
    Thanks,
    Coen
    Message was edited by:
    Coenos1

    Which Oracle version and OS are you on ? It works perfectly to me :
    $ cat myfile.csv
    107031035423278;913487654;20010101;20011231;3231729003;8334195582
    128039008378982;117347347;20010101;20011231;1606131689;4468506457
    134740829467773;450263934;20010101;20011231;9568986434;526201096
    141020256280899;782714783;20010101;20011231;33235678;2398903683
    146130347251892;960256796;20010101;20011231;441706397;2622754437
    151020336151123;441010528;20010101;20011231;8183416412;6077359802
    152888977527618;114572066;20010101;20011231;2370992895;6196483262
    $ sqlplus test/test
    SQL*Plus: Release 10.2.0.2.0 - Production on Fri Aug 24 10:56:30 2007
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> CREATE TABLE blabla (
      2  AANSLUITINGSNR_BV NUMBER(15),
      3  BSN_NR NUMBER(9),
      4  DATUM_AANVANG_UKV DATE,
      5  DATUM_EIND_UKV DATE,
      6  BEDR_WAO_WERKN_REFJ number(18),
      7  BEDR_WAO_WERKG_REFJ NUMBER(38)
      8  )
      9  ORGANIZATION EXTERNAL (
    10  TYPE oracle_loader
    11  DEFAULT DIRECTORY work
    12  ACCESS PARAMETERS (
    13  RECORDS DELIMITED BY NEWLINE
    14  FIELDS TERMINATED BY ';'
    15  MISSING FIELD VALUES ARE NULL
    16  (
    17  "AANSLUITINGSNR_BV",
    18  "BSN_NR",
    19  "DATUM_AANVANG_UKV" DATE "YYYYMMDD",
    20  "DATUM_EIND_UKV" DATE "YYYYMMDD",
    21  "BEDR_WAO_WERKN_REFJ",
    22  "BEDR_WAO_WERKG_REFJ"
    23  )
    24  )
    25  LOCATION ('myfile.csv')
    26  )
    27* REJECT LIMIT UNLIMITED
    SQL> /
    Table created.
    SQL> select * from blabla;
    AANSLUITINGSNR_BV          BSN_NR DATUM_AAN DATUM_EIN BEDR_WAO_WERKN_REFJ BEDR_WAO_WERKG_REFJ
      107031035423278       913487654 01-JAN-01 31-DEC-01          3231729003          8334195582
      128039008378982       117347347 01-JAN-01 31-DEC-01          1606131689          4468506457
      134740829467773       450263934 01-JAN-01 31-DEC-01          9568986434           526201096
      141020256280899       782714783 01-JAN-01 31-DEC-01            33235678          2398903683
      146130347251892       960256796 01-JAN-01 31-DEC-01           441706397          2622754437
      151020336151123       441010528 01-JAN-01 31-DEC-01          8183416412          6077359802
      152888977527618       114572066 01-JAN-01 31-DEC-01          2370992895          6196483262
    7 rows selected.
    SQL>What do you see within the log file ?

  • Problem trying to create and manage external tables

    Hello guys,
    I am having problems having created my external tables trying to select from them. I created the table thus:
    create table job_ext
    (job_id number(3),
    FUNCTION varchar2(30) )
    organization external (type oracle_datapump default directory test_dir
    access parameters (records delimited by newline fields delimited by "~" (job_id number(3) ,
    FUNCTION varchar2(30) ) )
    location ('testdump.lst')
    but on running select * from job_ext, I get the error
    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: "logfile, nologfile, version" etc..
    KUP-01008: the bad identifier was: records
    KUP-01007: at line 1 column 1
    ORA-06512: at "SYS.ORACLE_DATAPUMP", line 19
    ORA-06512: at line 1
    what am I not doing right.
    Secondly, I wish to ask if an directory object is created, will it be visible on the OS file system?? I am using Oracle 10g complete reference for study but it does not throw light on this.
    thanks

    Hi,
    It looks like you may need to grant permissions to the target directory.
    The ORA-29913 error can also happen in external tables when you don't grant read and write permissions to the directory:
    CREATE OR REPLACE DIRECTORY extdir AS '/u01/app/oracle./extdir';
    GRANT READ ON DIRECTORY extdir TO myowner;
    GRANT WRITE ON DIRECTORY extdir TO myowner;
    Also, see BUG 5172459 (MetaLink Note:373168.1)
    The problem is that the message file for external tables oin not the English version. These steps will address the issue:
    1. cd $ORACLE_HOME/rdbms/mesg
    2. cp KUP<lang>.msb KUP<lang>.msb.BAK
    3. cp kupus.msb KUP<lang>.msb
    http://www.dba-oracle.com/t_ora_29913_external_table_error.htm

  • Facing Many Problems About Creating Directory and an External Table

    Question:
    The weird thing is if you look at question 10-b in page 3-41, it says:
    (page 3-41 "Oracle Database 10g SQL Fund. II Vol.1")
    Merge the data in the EMP_DATA table created in the last lab into the data in the emp_hist table. Assume
    that the data in external EMP_DATA table matches the EMP_HIST table, update the email column
    of the EMP_HIST table to match the EMP_DATA table row. If a row in the EMP_DATA table does not
    match, insert into the EMP_HIST tables. Rows are considered matching when the employee's first and
    last name are identical.
    To me, this question is constructed wrongly. First of all in the last lab we have not been asked to create EMP_DATA. Secondly, EMP_DATA is empty.
    Thirdly, this question asks us to merge into EMP_HIST table while EMP_DATA is empty.
    EMP_HIST table currently has copied data from employees table. EMP_HIST structure:
    FIRST_NAME VARCHAR2(20)
    LAST_NAME NOT NULL VARCHAR2(25)
    EMAIL NOT NULL VARCHAR2(45)
    Anway, i did the merge as following:
    merge into emp_hist e
    using emp_data d
    on (e.first_name = d.first_name)
    when matched then
    update set
    e.last_name = d.last_name,
    e.email = d.email
    when not matched then
    insert values (d.first_name, d.last_name, d.email);
    I get this error:
    Error report:
    SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file emp.dat in EMP_DIR not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    29913. 00000 - "error in executing %s callout"
    *Cause:    The execution of the specified callout caused an error.
    *Action:   Examine the error messages take appropriate action.
    On the other hand, i said let me try this:
    merge into emp_data d
    using emp_hist e
    on (d.first_name = e.first_name)
    when matched then
    update set
    d.last_name = e.last_name,
    d.email = e.email
    when not matched then
    insert values (e.first_name, e.last_name, e.email);
    I get this error because external table is final once its created as far as i know:
    Error report:
    SQL Error: ORA-30657: operation not supported on external organized table
    30657.0000 - "operation not supported on external organized table"
    *Cause:    User attempted on operation on an external table which is
    not supported.
    *Action:   Don't do that!
    I do not know what to do. I did my best, please help.
    Edited by: user11164565 on Jul 27, 2009 2:43 AM

    user11164565 wrote:
    NOTE: I did my best, i did all what i can do, but the problem persists. Please help
    I will mention all the steps i did clearly....
    I gave scott the following grants:
    grant create any directory to scott;
    grant read on directory emp_dir to scott;
    1. Created a directory and its been created successfully:
    create or replace directory emp_dir
    as 'F:\emp_dir';
    Then i did the following just to make sure my directory is recognized:
    SELECT *
    FROM dba_directories;
    I found the drive amongst the results...
    OWNER DIRECTORY_NAME
    DIRECTORY_PATH
    SYS EMP_DIR
    F:\emp_dir
    SYS SUBDIR
    D:\oracle\product\10.2.0\db_1\demo\schema\order_entry\/2002/Sep
    SYS XMLDIR
    D:\oracle\product\10.2.0\db_1\demo\schema\order_entry\
    2. I created an external table emp_data (the script is given by the text book): done successfully
    drop table emp_data;
    CREATE TABLE emp_data
    (first_name VARCHAR2(20)
    ,last_name VARCHAR2(20)
    , email VARCHAR2(30)
    ORGANIZATION EXTERNAL
    TYPE oracle_loader
    DEFAULT DIRECTORY emp_dir
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE CHARACTERSET US7ASCII
    NOBADFILE
    NOLOGFILE
    FIELDS
    ( first_name POSITION ( 1:20) CHAR
    , last_name POSITION (22:41) CHAR
    , email POSITION (43:72) CHAR )
    LOCATION ('emp.dat') ) ;
    3. I went to F:\ drive to see if emp_dir folder exist or not! I did not see it. I checked hidden files, nothing there. Anyway, i ignored it and did step 4.
    <snip>
    "Anyway, I ignored it . . . "
    and hence the rest of your problems. I did not see in the steps you recounted that you acually created a directory ("folder") named "\emp_dir" on your f: drive. Nothing you create within the database will actually create that directory on the OS. Createing a directory in Oracle, createing an external table in Oracle, will only create pointers to objects that Oracle will simply assume actually exists.

  • Problem accessing external table

    Hello,
    When trying to access an external table, we're getting the following error.
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    ORA-01891: Datetime/Interval internal error
    ORA-06512: at "SYS.ORACLE_DATAPUMP", line 19
    Any recommendations?
    Thanks

    Metalink says
    Error:     ORA-1891
    Text:     Datetime/Interval internal error
    Cause:     Internal error.
    Action:     Please contact Oracle Worldwide Support.
    Can't find any other solution

Maybe you are looking for

  • How do I rebuild a new Mail account? (recipients not receiving e-mails)

    For the last few days, various e-mails I have sent have not reached their recipients when I send them from my Mail application. There is no pattern to whom is and is not receiving e-mails I have sent. All messages show as being Sent and I receive no

  • Error when debugging the Web DynPro application-Flight Example

    Hi all, I am trying to execute the Flight Application example. In the Search View I have entered City from and to and  getting only one record in the table control as output in Result View irrespective of any cities. I checked with SAPR/3 but it is s

  • How do I edit a WordPress site in Dreamweaver?

    I found a pretty good article on how to install WordPress to a localhost and run a site made locally on a test server through Dreamweaver (http://www.adobe.com/devnet/dreamweaver/articles/dw_wordpress_pt1.html), but it leaves a lot unanswered. Like..

  • New iMac Intel, won't do transitions, error message HELP!

    My daughter just bought a new Intel iMac, specifically for the purpose of making movies with iMovie. She has run into a problem trying to do transitions, using primarily Cross-Dissolve. Sometimes she can put them in and iMovie renders them. Then, oth

  • Menu Rollover Effects... please help

    I'm trying to make a menu that does sort of a cover-up slide motion, and text raising effect when the mouse moves over it. I've got the movie clips finished, and they do what I need them to, but when I preview my project, the animation/effect continu