Dynamic reading headers external table

Hi,
I have a lot (over 200) of different databases (acces, filemaker, excel, etc) which should be converted to Oracle. An application import (not Oracle) module exists but that application is very slow in importing. I wants to try to speed up this process by loading or quering these files as an external table.
Evey imported database has a different layout, columns etc. Also the number of columns are very high, about 80. Is there any way to dynamically read the file to be imported to extract the column names and map them as input for the create table for the external file? After that it's more easy to query that external file. In the current situation I have to create the table manually and that takes a lot of time.
Or does anyone have a suggestion for another import proces with sqlloader, datapump, or....?
Thanks,
Paul

Paul van Rixel wrote:
Hi,
I have a lot (over 200) of different databases (acces, filemaker, excel, etc) which should be converted to Oracle. An application import (not Oracle) module exists but that application is very slow in importing. I wants to try to speed up this process by loading or quering these files as an external table.
Evey imported database has a different layout, columns etc. Also the number of columns are very high, about 80. Is there any way to dynamically read the file to be imported to extract the column names and map them as input for the create table for the external file? After that it's more easy to query that external file. In the current situation I have to create the table manually and that takes a lot of time.
Or does anyone have a suggestion for another import proces with sqlloader, datapump, or....?
Thanks,
PaulThere is no way to dynamically read the file to be imported to extract the column names for an external table - the names must be hard-coded.
This may be doable in a different way, however, depending on how much work you want to do and pain you're willing to endure to accomplish it.
The easiest way is probably have a different external table for each layout with the proper definitions.
Doing this dynamically might be possible but will probably be harder. Dynamic solutions can range from PL/SQL/Java/whatever procedures to read, parse, collect, and insert the data dynamically using data embedded in the files themselves. This will be very hard. Possiblities include using UTL_FILE and possibly pipelined functions which can use UTL_FILE internally defining table output externally.
Some tools offer GUI interfaces to manual file loading. Apex, for instance, can read and load a file derving column names from the first record. Perhaps this is something like what you want to do
Good luck!

Similar Messages

  • Reading through external tables

    How can I read multiple .csv files kept at a location into one external table.
    eg:
    create table ext_table_csv (
    i Number,
    n Varchar2(20),
    m Varchar2(20)
    organization external (
    type oracle_loader
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ','
    missing field values are null
    location ('file.csv')
    reject limit unlimited;
    In the above example I read the file "file.csv"
    I have a directory where this file "file.csv" is kept.
    I have many such files kept in the same directory and these files are kept by some other entity and i dont know the names of all the files and also not hte number of files. I only know that these are .csv files
    Is there any way in which I can read all the files , something like wildcard as *.csv or anything else.
    thanx in advance!!!
    Edited by: Commander on Dec 4, 2008 10:39 PM

    you can you the following command to get all the list of csv files in the folder.. like
    ECLARE
    pattern VARCHAR2(1024) := '/u01/oracle/admin/SID/udump';
    ns VARCHAR2(1024);
    BEGIN
    SYS.DBMS_BACKUP_RESTORE.searchFiles(pattern, ns);
    FOR each_file IN (SELECT FNAME_KRBMSFT AS name FROM X$KRBMSFT WHERE FNAME_KRBMSFT LIKE '%.trc') LOOP
    DBMS_OUTPUT.PUT_LINE(each_file.name);
    END LOOP;
    END;
    Note: it only available in 10g
    Reference: http://www.chrispoole.co.uk/tips/plsqltip2.htm  Then you can use dynamic sql to create a external table or only alter the location of the csv file..

  • Upload file to read as external table from client to DB server using webutil

    Hi I was wondering if this is possible
    The requirement is I need to up load a comaseprate file to db server from client, so to read this fie as an external table
    When we have doing is to create a samba share on the DB server and just do a copy to the network share and consequentially read the file in to the database
    My environment - Forms 11R2 and 11g2
    Can this be done using webutil ( from client to db server
    Thanks nad regards

    Hi thanks for the reply!
    Currently the application runs with a samba share, we need to get read of this share and directly load the file to DB server (on unix file system, then there wont be much changes to the existing code), is this possible?
    Ells I was thinking the same as you say just load the file in to the database and do some other PL/Sql or shell scripts to do the rest of the operation. it would be better to use a PL/Sql via a trigger I believe unfortunately I am not an Pl/Sql programmer ((, guess one of our developers need to find the coding part ))
    Appreciate if you can give me some example like
    Thanks and best regards

  • Dynamic reading from database table

    Hi Experts,
    While reading from a database table the below statement for deletion works:
    DELETE (p_table) FROM <fs_wadbtab>.
    p_table: name of database table which is entered as a selection screen parameter
    <fs_wadbtab> : workarea of line type P_table
    However, the below statement does not work:
    READ (p_table) FROM <fs_wadbtab>.
    My requirement is to read a record from p_table with contents in a dynamic structure.
    Kindly suggest.
    Thanks.

    Just misunderstood you.
    Edited by: Karri Kemppi on Jun 23, 2010 10:00 AM

  • Can i create External Table dynamically

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

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

  • External Table Loads - Insufficient Privs

    Hi...please advise:
    Facts:
    1. I have 2 schemas: SCHEMA_A and SCHEMA_B
    2. I have an oracle directory 'VPP_DIR' created under SCHEMA_A and granted WRITE and READ on the dir to SCHEMA_B.
    3. The physical dir on the unix server to which VPP_DIR points has read, write, execute privs for the Oracle user.
    4. I have a procedure in SCHEMA_A (CET_PROC) which dynamically creates the external table with parameters passed to it like directory_name, file_name, column_definitions, load_when_clause etc.
    5. The CET_PROC also does a grant SELECT on external table to SCHEMA_B once it is created.
    6. SCHEMA_B has EXECUTE privs to SCHEMA_A.CET_PROC.
    7. SCHEMA_B has a proc (DO_LOAD_PROC) that calls SCHEMA_A.CET_PROC.
    At the point where SCHEMA_A.CET_PROC tries to do the EXECUTE_IMMEDIATE command with the create table code, it fails with "ORA-01031: insufficient privileges"
    If I execute SCHEMA_A.CET_PROC from within SCHEMA_A with the same parameters it works fine.
    If I create CET_PROC inside SCHEMA_B and execute this version from within SCHEMA_B it works fine.
    From accross schemas, it fails. Any advice...please?

    Works for me without CREATE ANY TABLE.
    I found it easier to follow the permissions if I replaced SCHEMA_A and SCHEMA_B with OVERLORD and FLUNKY.
    /Users/williamr: cat /Volumes/Firewire1/william/testexttable.dat
    1,Eat,More,Bananas,TodayAs SYS:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Account: SYS@//centosvm.starbase.local:1521/dev10g.starbase.local
    SQL> CREATE USER overlord IDENTIFIED BY overlord                         
      2  DEFAULT TABLESPACE users QUOTA UNLIMITED ON users ACCOUNT UNLOCK;
    User created.
    SQL> CREATE USER flunky IDENTIFIED BY flunky
      2  DEFAULT TABLESPACE users QUOTA UNLIMITED ON users ACCOUNT UNLOCK;
    User created.
    SQL> GRANT CREATE SESSION, CREATE TABLE, CREATE PROCEDURE TO overlord,flunky;
    Grant succeeded.
    SQL> GRANT READ,WRITE ON DIRECTORY extdrive TO overlord;
    Grant succeeded.As OVERLORD:
    Account: OVERLORD@//centosvm.starbase.local:1521/dev10g.starbase.local
    SQL> get afiedt.buf
      1  CREATE OR REPLACE PROCEDURE build_xt
      2      ( p_data OUT SYS_REFCURSOR )
      3  AS
      4      v_sqlstr VARCHAR2(4000) := q'|
      5          CREATE TABLE test_xt
      6          ( id   NUMBER(8)
      7          , col1 VARCHAR2(10)
      8          , col2 VARCHAR2(10)
      9          , col3 VARCHAR2(10)
    10          , col4 VARCHAR2(10) )
    11          ORGANIZATION EXTERNAL
    12          ( TYPE oracle_loader
    13            DEFAULT DIRECTORY extdrive
    14            ACCESS PARAMETERS
    15            ( RECORDS DELIMITED BY newline
    16              BADFILE 'testexttable.bad'
    17              DISCARDFILE 'testexttable.dsc'
    18              LOGFILE 'testexttable.log'
    19              FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    20              ( id, col1, col2, col3, col4 ) )
    21           LOCATION ('testexttable.dat') )
    22           |';
    23  BEGIN
    24      EXECUTE IMMEDIATE v_sqlstr;
    25      OPEN p_data FOR 'SELECT * FROM test_xt';
    26* END build_xt;
    27 
    28  .
    SQL> @afiedt.buf
    Procedure created.
    SQL> grant execute on build_xt to flunky;
    Grant succeeded.
    SQL> -- Prove it works:
    SQL> var results refcursor
    SQL>
    SQL> exec build_xt(:results)
    PL/SQL procedure successfully completed.
            ID COL1       COL2       COL3       COL4
             1 Eat        More       Bananas    Today
    1 row selected.
    SQL> drop table test_xt purge;
    Table dropped.As FLUNKY:
    Account: FLUNKY@//centosvm.starbase.local:1521/dev10g.starbase.local
    SQL> SELECT * FROM user_sys_privs;
    USERNAME                       PRIVILEGE                                ADM
    FLUNKY                         CREATE TABLE                             NO
    FLUNKY                         CREATE SESSION                           NO
    FLUNKY                         CREATE PROCEDURE                         NO
    3 rows selected.
    SQL> var results refcursor
    SQL>
    SQL> exec overlord.build_xt(:results)
    PL/SQL procedure successfully completed.
            ID COL1       COL2       COL3       COL4
             1 Eat        More       Bananas    Today
    1 row selected.

  • How to ''give'' error for this case of an EXTERNAL TABLE?

    Our external table routine works fine:
    -- We have a csv file with 2 cols.
    -- When we create the table referring the csv it works fine.
    -- Even if the csv has more the 2 cols, the ET command only takes the 2 cols and it works fine.
    -- Now, users are saying that if the csv has more than 2 cols, the ET command should give an error
    I went through the command but cannot find any clause which will do this.
    Is there any other way or workaround?
    CREATE TABLE <table_name> (
    <column_definitions>)
    ORGANIZATION EXTERNAL
    (TYPE oracle_loader
    DEFAULT DIRECTORY <oracle_directory_object_name>
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY newline
    BADFILE <file_name>
    DISCARDFILE <file_name>
    LOGFILE <file_name>
    [READSIZE <bytes>]
    [SKIP <number_of_rows>
    FIELDS TERMINATED BY '<terminator>'
    REJECT ROWS WITH ALL NULL FIELDS
    MISSING FIELD VALUES ARE NULL
    (<column_name_list>))\
    LOCATION ('<file_name>'))
    [PARALLEL]
    REJECT LIMIT <UNLIMITED | integer>;
    Is it possible to use the READSIZE?
    Edited by: Channa on Sep 23, 2010 2:28 AM

    -- Now, users are saying that if the csv has more than 2 cols, the ET command should give an error
    I went through the command but cannot find any clause which will do this.
    Is there any other way or workaround?I looked at Serverprocess' sql*loader script and did not see how that would answer your question - how to raise an error if the file has more than 2 columns. If I missed something can Serverprocess explain?
    I can't think of a direct way to do this with your external table either, but there may be indirect ways. Some brainstorming ideas of perhaps dubious usefulness follow.
    Placing a view over the external table can limit results to the first two columns but won't raise an error.
    A pipelined function can read the external table, check for data where there shouldn't be any, and raise an exception when you find data in columns where there should not be any.
    Similarly, you could ditch the external table and use utl_file to read the file, manually parsing and checking the data. LOTS more work but more control on your end. External tables are much easer to use :(
    Or, first load the external table into a work table before the "real" select. Check the work table for the offending data programatically and raise an error if data is where it should not be. You could keep the existing external table and not have to do a lot of recoding.
    Or, also load the data into an otherwise unneeded global temporary table first. Use a trigger on the load to look for the unwanted data and raise an error if offending data is there
    These ideas are boiling down to variations on validating the data before you use it.
    Good luck!

  • External Table and HTTP

    All,
    Is it possible to specify a URL as the location of a file for an external table? (e.g. http://www.somesite.com/somedir/somefile.csv)
    For some organizations, getting files onto the actual Oracle server is a difficult process because they tend to be managed externally, often by an entirely different group from the ones doing the DBA work. NFS, FTP drop-zones, etc. all seem to be considered security risks. Being able to pull directly across a protocol would be a very nice feature.

    You need to specify a directory object from where the file is being read by external table. May be you can try creating a directory object which maps to the directory in the network. It may work if the directory is accessible from the server.

  • Does external table creation creates redo log ?

    Hi all,
    I am on Oracle 10.1 on Solaris, but my question is generic.
    I am creating an external table from a CSV text file. In the process of creating and reading (using) this external table any REDO information will be generated?
    Till 8i, for loading CSV files, I would load the file with SQL*loader to a staging table and then process the data. This process of loading to staging table will create redo log information (unless I use NOLOGGING, which I cannot use for some reason).
    Since 9i and 10g, I can create external table of the CSV file and use it. What can be the internal working of external table? Does it load the data to some temporary table internally (transparant to us)? or does Oracle reads the external source file as it needs it?
    Important question is, in the whole affair of using a read-only external table, will Oracle create redo log information?
    Please help.
    Regards

    I am creating an external table from a CSV text file. In the process of creating and reading (using) this external table any REDO information will be generated? <<The create statement will generate redo for the rdbms dictionary changes. If the nologging parameter is legal on a create statement for an external table it will have no effect since DDL is always logged. The insert select will generate redo for the inserts into the target table so again creating the external table as nologging would have no effect on the subsequent use of the table.
    If you just select against the external table then no redo should be generated.
    HTH -- Mark D Powell --

  • External Table which can handle appending multiple csv files dynamic

    I need an external table which can handle appending multiple csv files' values.
    But the problem I am having is : the number of csv files are not fixed.
    I can have between 2 to 6-7 files with the suffix as current_date. Lets say it will be like my_file1_aug_08_1.csv, my_file1_aug_08_2.csv, my_file1_aug_08_3.csv etc. and so on.
    I can do it by following as hardcoding if I know the number of files, but unfortunately the number is not fixed and need to something dynamically to inject with a wildcard search of file pattern.
    CREATE TABLE my_et_tbl
      my_field1 varchar2(4000),
      my_field2 varchar2(4000)
    ORGANIZATION EXTERNAL
      (  TYPE ORACLE_LOADER
         DEFAULT DIRECTORY my_et_dir
         ACCESS PARAMETERS
           ( RECORDS DELIMITED BY NEWLINE
            FIELDS TERMINATED BY ','
            MISSING FIELD VALUES ARE NULL  )
         LOCATION (UTL_DIR:'my_file2_5_aug_08.csv','my_file2_5_aug_08.csv')
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    NOMONITORING;Please advice me with your ideas. thanks.
    Joshua..

    Well, you could do it dynamically by constructing location value:
    SQL> CREATE TABLE emp_load
      2      (
      3       employee_number      CHAR(5),
      4       employee_dob         CHAR(20),
      5       employee_last_name   CHAR(20),
      6       employee_first_name  CHAR(15),
      7       employee_middle_name CHAR(15),
      8       employee_hire_date   DATE
      9      )
    10    ORGANIZATION EXTERNAL
    11      (
    12       TYPE ORACLE_LOADER
    13       DEFAULT DIRECTORY tmp
    14       ACCESS PARAMETERS
    15         (
    16          RECORDS DELIMITED BY NEWLINE
    17          FIELDS (
    18                  employee_number      CHAR(2),
    19                  employee_dob         CHAR(20),
    20                  employee_last_name   CHAR(18),
    21                  employee_first_name  CHAR(11),
    22                  employee_middle_name CHAR(11),
    23                  employee_hire_date   CHAR(10) date_format DATE mask "mm/dd/yyyy"
    24                 )
    25         )
    26       LOCATION ('info*.dat')
    27      )
    28  /
    Table created.
    SQL> select * from emp_load;
    select * from emp_load
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    SQL> set serveroutput on
    SQL> declare
      2      v_exists      boolean;
      3      v_file_length number;
      4      v_blocksize   number;
      5      v_stmt        varchar2(1000) := 'alter table emp_load location(';
      6      i             number := 1;
      7  begin
      8      loop
      9        utl_file.fgetattr(
    10                          'TMP',
    11                          'info' || i || '.dat',
    12                          v_exists,
    13                          v_file_length,
    14                          v_blocksize
    15                         );
    16        exit when not v_exists;
    17        v_stmt := v_stmt || '''info' || i || '.dat'',';
    18        i := i + 1;
    19      end loop;
    20      v_stmt := rtrim(v_stmt,',') || ')';
    21      dbms_output.put_line(v_stmt);
    22      execute immediate v_stmt;
    23  end;
    24  /
    alter table emp_load location('info1.dat','info2.dat')
    PL/SQL procedure successfully completed.
    SQL> select * from emp_load;
    EMPLO EMPLOYEE_DOB         EMPLOYEE_LAST_NAME   EMPLOYEE_FIRST_ EMPLOYEE_MIDDLE
    EMPLOYEE_
    56    november, 15, 1980   baker                mary            alice     0
    01-SEP-04
    87    december, 20, 1970   roper                lisa            marie     0
    01-JAN-99
    SQL> SY.
    P.S. Keep in mind that changing location will affect all sessions referencing external table.

  • How to read any file using external tables.

    Hi folks,
    I have written an application that reads a series of csv files using external tables which works fine as long as I specify each file name in the directory i.e.......
    CREATE TABLE gb_test
    (file_name varchar2(10),
    rec_date date
    rec_name VARCHAR2(20),
    rec_age number,
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY GB_TEST
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    LOCATION ('data1.csv','data2.csv','data3.csv','data4.csv')
    PARALLEL 5
    REJECT LIMIT 20000;
    However I have discovered that I may not know the name of the files to be processed prior to the program being run so just want to read any file regardless of it's name (although it will always be a .csv file).
    Is there a way to ensure that you don't need to specify the files to be read in the LOCATION part of the syntax.
    Thanks in advance.
    Graham.

    Right, I have now completed this, however it's currently only working as SYS as opposed to any user, however here is a detail of the scenario and the steps required in case any of you guys need in the future ......
    The problem was I needed to search for csv files on my hard-drive. These files would be stored in a series of directories (a through to z), so I needed a way to read all 26 directories and process all files in these directories.
    The problem was, prior to running the program, the user would remove all the files in the directories and insert new ones, but it was never known how many he would decide to do each time.
    Solution: I created a table called stock_data_directories as follows ...
    create table stock_data_directories(sdd_rec_no number,
    sdd_table_name varchar2(50),
    sdd_directory_name varchar2(50),
    sdd_directory_path varchar2(100));
    Then inserted 26 records like ...
    insert into stock_data_directories(sdd_rec_no,sdd_table_name,sdd_directory_name,sdd_directory_path)
    values(1,'rawdata_a','KPOLLOCKA','C:\KPOLLOCK\A')
    insert into stock_data_directories(sdd_rec_no,sdd_table_name,sdd_directory_name,sdd_directory_path)
    values(2,'rawdata_b','KPOLLOCKB','C:\KPOLLOCK\B');
    etc...etc...
    Then created 26 DIRECTORIES E.G.
    CREATE OR REPLACE DIRECTORY KPOLLOCKA AS 'C:\KPOLLOCK\A';
    CREATE OR REPLACE DIRECTORY KPOLLOCKB AS 'C:\KPOLLOCK\B';
    Then created 26 external tables like the following ...
    CREATE TABLE rawdata_a
    (stock varchar2(1000),
    stock_date varchar2(10),
    stock_open VARCHAR2(20),
    stock_high varchar2(20),
    stock_low varchar2(20),
    stock_close VARCHAR2(30),
    stock_qty varchar2(20) )
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY KPOLLOCKA
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ','
    LOCATION ('AA.csv')
    PARALLEL 5
    REJECT LIMIT 20000
    This basically says in directory rawdata_a it currently has 1 file called AA.csv.
    Then wrote a procedure as follows ...
    procedure p_process_files(pv_return_message OUT varchar2)is
    cursor c_get_stock_data_directories is
    select distinct sdd_directory_path,
    sdd_table_name
    from stock_data_directories
    order by sdd_table_name;
    vv_return_message varchar2(1000);
    begin
    -- here get the files for each directory
    for r_get_stock_directories in c_get_stock_data_directories loop
    p_build_external_table(r_get_stock_directories.sdd_directory_path,
         r_get_stock_directories.sdd_table_name,
         vv_return_message);
    end loop;
    end;
    then wrote a procedure called p_build_external_table as follows ...
    procedure p_build_external_table(pv_directory_path IN stock_data_directories.sdd_directory_path%type, -- e.g. 'C:\kpollock\A\
    pv_table_name IN stock_data_directories.sdd_table_name%type, -- e.g. rawdata_a
    pv_return_message OUT varchar2) is
    vv_pattern VARCHAR2(1024);
    ns VARCHAR2(1024);
    vv_file_name varchar2(4000);
    vv_start_string varchar2(1) := '''';
    vv_end_string varchar2(3) := ''',';
    vn_counter number := 0;
    vv_err varchar2(2000);
    BEGIN
    vv_pattern := pv_directory_path||'*';
    SYS.DBMS_BACKUP_RESTORE.searchFiles(vv_pattern, ns);
    FOR each_file IN (SELECT FNAME_KRBMSFT AS name FROM X$KRBMSFT) LOOP
    if each_file.name like '%.CSV' then
    vv_file_name := vv_file_name||vv_start_string||substr(each_file.name,instr(each_file.name,'\',1,3)+1)||vv_end_string;
         vn_counter := vn_counter + 1;
    end if;
    END LOOP;
    vv_file_name := substr(vv_file_name,1,length(vv_file_name)-1); -- remove final , from string
    execute immediate 'alter table '||pv_table_name||' location('||vv_file_name||')';
    pv_return_message := 'Successfully changed '||pv_table_name||' at '||pv_directory_path||' to now have '||to_char(vn_counter)||' directories';
    exception
    when others then
    vv_err := sqlerrm;
    pv_return_message := ' Error found updating directories. Error = '||vv_err;
    END;
    This reads every file in the directory and appends it to a list, so if it finds A.csv and ABC.csv, then using the dynamic sql, it alters the location to now read 'a.csv','abc.csv',
    It ignores all other file extentions.

  • Error while reading data through External Table!!!

    CREATE TABLE "COGNOS"."EXT_COGNOS_TBS9_TEST"
    (     "ITEM_DESC" VARCHAR2(200 BYTE),
    "EXT_CODE" VARCHAR2(20 BYTE),
    "RC_DATE" DATE,
    "RES_KD_AMNT" NUMBER(18,3),
    "RES_FC_AMNT" NUMBER(18,3),
    "NRES_KD_AMNT" NUMBER(18,3),
    "NRES_FC_AMNT" NUMBER(18,3),
    "TOTAL" NUMBER(18,3),
    "OF_WHICH_OVR1" NUMBER(18,3)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY "EXTDATADIR"
    ACCESS PARAMETERS
    ( RECORDS
    DELIMITED BY NEWLINE LOAD WHEN *({color:#ff0000}EXT_CODE LIKE 'TBS9%'{color})* FIELDS TERMINATED BY ','
    MISSING FIELD VALUES ARE NULL )
    LOCATION
    ( 'TBS9_TEST.CSV'
    External table creation went through successfully but am getting error while reading data. Am quite sure error is because of above line in red color. Could you please help me in transforming logic.
    Thanks in Advance,
    AP

    Let's start with the basics...
    1) You state that you are getting an error. What error do you get? Is this an Oracle error (i.e. ORA-xxxxx)? If so, please include the error number and the error message as well as the triggering statement. Or is the problem that rows are getting written to the reject file and errors are being written to the log file? If so, what record(s) are being rejected and what are the reasons given in the log file? Or perhaps the problem is something else?
    2) You state that you are quite sure that the problem relates to the hilighted code. What makes you quite sure of this?
    Justin

  • Unable to read chinese characters in a flat file to external table

    Hi All,
    We have a flat file containing data in chinese. We are using external table to read data in files. When i do select <coulmn-name> from <table> it displays box for the chinese characters. The column is of type varchar2.
    The NLS_LANGUAGE is AMERICAN and NLS_CHARACTERSET is AL32UTF8.
    The character set is mentioed as UTF8 in external table defnition.
    Is the external table not reading these charcters properly? Should any patch be installed or some settings should be changed for sql developer to to display chinese character?

    The NLS_LANG environment variable/registry string variable (You are just one of the 1000s of 'anonymous' users refusing to post platform and version), so NOT NLS_LANGUAGE, on the server hosting the file, should be set to anything ending in .AL32UTF8
    Sybrand Bakker
    Senior Oracle DBA

  • Dynamic headers in table control

    Hi,
    How to create dynamic headers in table control headers?
    I have to replace the header labels with internally computed headers.
    I have created input fields for headers..
    Regards,
    Krutika

    Hi Krutika,
    Try this out,
    Populate an internal tabel with all the dates and day in it and also populate the column position  in it.
    say you have populated all this in an internal table it_date----fields in the internal table
    1. date
    2. day
    3. spot1 -
    column name of the table control(spot1 represents the column position)
    then do this ,
    LOOP AT it_date INTO wa_date.
       LOOP AT SCREEN .
    *WHERE screen-name = wa_date-spot.
        CASE wa_date-spot.
          WHEN 'SPOTS1'.
            spots1 = wa_date-dd.
          WHEN 'SPOTS2'.
            spots2 = wa_date-dd.
          WHEN 'SPOTS3'.
            spots3 = wa_date-dd.
          WHEN 'SPOTS4'.
            spots4 = wa_date-dd.
          WHEN 'SPOTS5'.
            spots5 = wa_date-dd.
          WHEN 'SPOTS6'.
            spots6 = wa_date-dd.
          WHEN 'SPOTS7'.
            spots7 = wa_date-dd.
          WHEN 'SPOTS8'.
            spots8 = wa_date-dd.
          WHEN 'SPOTS9'.
            spots9 = wa_date-dd.
          WHEN 'SPOTS10'.
            spots10 = wa_date-dd.
          WHEN 'SPOTS11'.
            spots11 = wa_date-dd.
          WHEN 'SPOTS12'.
            spots12 = wa_date-dd.
          WHEN 'SPOTS13'.
            spots13 = wa_date-dd.
          WHEN 'SPOTS14'.
            spots14 = wa_date-dd.
          WHEN 'SPOTS15'.
            spots15 = wa_date-dd.
          WHEN 'SPOTS16'.
            spots16 = wa_date-dd.
          WHEN 'SPOTS17'.
            spots17 = wa_date-dd.
          WHEN 'SPOTS18'.
            spots18 = wa_date-dd.
          WHEN 'SPOTS19'.
            spots19 = wa_date-dd.
          WHEN 'SPOTS20'.
            spots20 = wa_date-dd.
          WHEN 'SPOTS21'.
            spots21 = wa_date-dd.
          WHEN 'SPOTS22'.
            spots22 = wa_date-dd.
          WHEN 'SPOTS23'.
            spots23 = wa_date-dd.
          WHEN 'SPOTS24'.
            spots24 = wa_date-dd.
          WHEN 'SPOTS25'.
            spots25 = wa_date-dd.
          WHEN 'SPOTS26'.
            spots26 = wa_date-dd.
          WHEN 'SPOTS27'.
            spots27 = wa_date-dd.
          WHEN 'SPOTS28'.
            spots28 = wa_date-dd.
          WHEN 'SPOTS29'.
            spots29 = wa_date-dd.
          WHEN 'SPOTS30'.
            spots30 = wa_date-dd.
          WHEN 'SPOTS31'.
            spots31 = wa_date-dd.
        ENDCASE.
    Hope this helps you,
    Regards,
    Abhijit G. Borkar

  • Headers appear in external table

    I have defined several external tables over text files that have been built in the same way - in excel, then saved as a csv file.
    Most of them work fine but there is one that always returns the column headers as data. I cant understand how this happens for this one file when they are all built in the the same way. I have checked the ddl for the external tables and they are equivalent.
    I realise I could set it to skip 1 row but I am loathe to do that because if this is some sort of bug then it may be resolved later resulting in the first row of data being lost - a problem that may not become obvious until found by end users.
    I have tried rebuilding from scratch and get the same result.
    Has anyone else faced this situation?

    I don't know what the exact trick is that OWB does,
    but when you sample the file you use for the external
    table and tell OWB to use the first row for the
    header names, it won't use the first line as a data
    line, even though there's nothing to be found in the
    external table definition that indicates that.Hi,
    that's no trick. If you sample the file and use the first row for column names the first row only disapears in the wizard. The resulting external table definition doesn't contain a skip row statement in this case automatically. The reason why you don't recognize this is because per default the loader writes no bad files. So the header row is normally ignored (because it doesn't match the structure) and you don't find it in the external table. If you will configure your external tables based on a file with an header and a skip parameter = 0 to produce a bad file (Bad File Name = file.bad) you will find the header row in this bad file then.
    The only right way ist to configure the skip parameter - not to repress the resulting errors.
    In this special file I guess the header matches the structure of the external table, so it isn't ignored but loaded into the external table.
    Regards,
    Detlef

Maybe you are looking for

  • How to insert new service condition in PO using BAPI_PO_CHANGE?

    Hi all, I'm trying to insert a new condition under a service line in a PO. This can be seen in ME23N under the services tab of the PO item. Then click on conditions (the button with the dollar and yen symbol). I tried using the internal table POCOND

  • Download a PDF file with a Bfile field

    Hello, my name is Massimo and i'am looking for an jsp example where is possible download a PDF stored in a file system accessed with a Bfile column. Thanks

  • How can I get my graph to stop auto-scaling?

    I am not a new programmer and I know how to make a graph auto-scale... IF I want it to.  However, I have a cluster of graphs (strip charts and waveform graphs act the same) that take in values and update each time.  My issue is that I have a static w

  • User start date can not be before the current date

    I'm creating users using the Reconciliation engine. The start date attribute doesn't appear to be reconciling. I get many different types of parse errors. The closest I appear to get is when I set the Xellerate User resource object recon field to hav

  • Multiple file associations

    I would like to open NEFs in either Photoshop or Nikon Capture NX2 (depending on the picture). I would like to be able to have Photoshop as my default application, so that if I double-click on the thumbnail, the picture will open in Photoshop. But I