Ssis - import data from flat file to table (sql server 2012)

i have create a ssis for importing data from flat file to table in sql server 2012.
but i got the below error for some column in data flow task.
error: cannot processed because than one code page (950 and 1252)
anyone helps~

Hi,
The issue occurs because the source flat file uses ANSI/OEM – Tranditional Chinese Big5 encoding. When processing the source file, the flat file connection manager uses code page 950 for the columns. Because SQL Server uses code page to perform conversions
between non-Unicode data and Unicode data, the data in the code page 950 based input columns cannot be loaded to code page 1252 based destination columns. To resolve the issue, you need to load the data into a SQL Server destination table that includes Unicode
columns (nchar or nvarchar), and convert the input columns to Unicode columns via Data Conversion or the Advanced Editor for the Flat File Source at the same time.
Another option that may not be that practical is to create a new database based on the Chinese_Taiwan_Stroke_BIN collation, and load the data to non-Unicode columns directly.
Reference:
http://social.technet.microsoft.com/Forums/windows/en-US/f939e3ba-a47e-43b9-88c3-c94bdfb7da58/forum-faq-how-to-fix-the-error-the-column-xx-cannot-be-processed-because-more-than-one-code-page?forum=sqlintegrationservices 
Regards,
Mike Yin
TechNet Community Support

Similar Messages

  • Extract data from Flat file CSV to SQL Server 2008 using SSIS 2008 (Data gets corrupted when extraction)

    Hi,
    I am trying to extract data from multiple CSV files to SQL into a single table. The data type of all the columns in SQL table is nvarchar(MAX).  I am able to extract the data from the flat files but some of the data(on extraction) is
    corrupt including question marks(?) and other invalid special characters. Also I tried selecting the UTF-8, 65001(Unicode) format but the problem still persists. Also I tried using data converter but no use.
    I checked with the data in the flat file but there is no data with question mark(?) or any other special characters.
    The separator in the flat file is Comma(,)
    Please help.
    Thanks in advace.

    The source system and application determines the code page and encoding. Is it Windows, Unix, Mainframe or some other type? 
    Unicode files sometimes begin with a byte order mark (2 bytes) to indicate little or big endian.  If you open the file in notepad and then select save as, the encoding in the dialog will show the encoding notepad detected based on the BOM.  If
    that is ANSI instead of Unicode or UTF-8, you will need to know the code page the source system used when the file was created.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Loading data from flat file to table

    Hi,
    I am using OWB 10g R2. I have to develop a map which loads data from flat file to table.
    1. I have created a .csv file.
    2. Import that into OWB by Module Wizard.
    3. I have created one external table, which use the .csv file.
    After that what I have to do for successfully loading the data into table.
    Regards,
    Sanjoy

    Hi Sanjoy
    You can building a mapping to move the data from somewhere to somewhere else. More specifically;
    1. create a mapping
    2. add external table to mapping
    3. add table to mapping for target (it can be unbound)
    4. map from external table ingroup to target table ingroup (all columns will be mapped)
    5. if target table was unbound right click on target table and click create and bind
    This is a basic mapping you can have for this scenario. There is a post here which does something like this, but it will create a File to Table mapping which will use SQLLoader.
    http://blogs.oracle.com/warehousebuilder/2009/01/expert_useful_scripts_from_simple_primitives.html
    Cheers
    David

  • Importing data from Flat file

    Hi all Experts,
    I am a ABAPer and trying to learn BW by my own. I wanted to import data from flat file and generate some reports on that.
    Can anybody tell me the steps starting from the infocubes(guess its the first step), to achieve it. Any help will be a great help for me.
    Thanks in Advance,
    Smita

    1.to start with create infoareas, infoobjects(accoring to what u have in flat file).
    2.then create a cube which will include these infoobj's and activate it.
    3.create an application component and then create infosource,right click and assign ds to infosource and specify ur PC file source system(whatever system u've), 4.then u'll go to the infosource screen where u need to maintain the exact order of ur file in transfer structure tab, then maintain transfer rules, activate it.
    5.create upate rules for ur cube by mentioning this infosource name.
    6.create infopackages and schedule them. after data is loaded to cube, use tcode rrmx and logon to bex and find ur cube and then create queries on them.

  • Extra column to be added while importing data from flat file to SQL Server

    I have 3 flat files with only one column in a table.
    The file names are bars, mounds & mini-bars.
    Table 'prd_type' has columns 'typeid' & 'typename' where typeid is auto-incremented and typename is bars, mounds & mini-bars.
    I Import data from 3 files to prd_details table. This table has columns 'pid', 'typeid' & 'pname' where pid is auto-incremented and pname is mapped to flat files and get info from them, now i wanted the typeid info to be received from prd_type table.
    Can someone please suggest me on this?

    You can get it as follows
    Assuming you've three separate data flow tasks for three files you can do this
    1. Add a new column to pipeline using derived column transformation and hardcode it to bars, mounds or mini-bars depending on the source
    2. Add a look task based on prd_type table. use query as
    SELECT typeid,typename
    FROM prd_type
    Use full cache option
    Add lookup based on derived column. new column -> prd_type.typename relationship. Select typeid as output column
    3. In the final OLEDB destination task map the typeid column to tables typeid column.
    In case you use single data flow task you need to include a logic based on filename or something to get the hardcoded type value as bars, mounds or mini-bars in the data pipeline
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Trying to import data from Flat file(csv)

    Hi,
    I am relatively new to ODI. While i try toimport data from a csv file in ODI and view the data, it gives an error ORA-00942: table or view does not exist. Actually where does it create the table is it in the Database associated with it?
    I have created a Logical Architecture, Physical Architecture and created a model and trying to import data into new data store through csv file.
    Thank You
    Edited by: VijayKank4610 on Oct 8, 2012 6:32 AM

    VijayKank4610 wrote:
    Actually where does it create the table is it in the Database associated with it?Your better off checking the Operator logs, you will see exactly which step failed and where it is trying to create the object (C$ table, I$ table, Target table) - The C$ and I$ tables will be in your work schema defined on your physical connection, remember you connecting user on the dataserver needs acccess to the work schema (able to create objects) and the target / data schema.

  • Uploading data from flat file to table control

    HI All,
    I want to upload data to OVKK tcode using BDC. For this I wrote Z program as shown below:
    REPORT ZSD_BDC_OVKK_UPLOAD
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    *INCLUDE bdcrecx1.
    DATA : BEGIN OF T_DUMMY OCCURS 0,
           VAR(100) TYPE C,
           END OF T_DUMMY.
    DATA:  BEGIN OF ITAB OCCURS 0,
           KALSM(10) TYPE C,
    *       KARTV(10) TYPE C,
           VKORG(4) TYPE C,
           VTWEG(2) TYPE C,
           SPART(2) TYPE C,
           KALVG(1) TYPE C,
           KALKS(1) TYPE C,
             KALSM(6) TYPE C,
             KARTV(4) TYPE C,
           END OF ITAB.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : v_filename TYPE string.
    PARAMETER : filename LIKE rlgrap-filename OBLIGATORY.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          field_name = filename
        CHANGING
          file_name  = filename.
    START-OF-SELECTION.
      v_filename = filename.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_filename
          filetype                      = 'ASC'
         has_field_separator           = 'X'
        TABLES
          data_tab                      = T_DUMMY.
    LOOP AT T_DUMMY.
        ITAB-VKORG = T_DUMMY-VAR+0(4).
        ITAB-VTWEG = T_DUMMY-VAR+5(2).
        ITAB-SPART = T_DUMMY-VAR+8(2).
        ITAB-KALVG = T_DUMMY-VAR+11(1).
        ITAB-KALKS = T_DUMMY-VAR+13(1).
        ITAB-KALSM = T_DUMMY-VAR+15(6).
        ITAB-KARTV = T_DUMMY-VAR+22(4).
        APPEND ITAB.
    ENDLOOP.
    DATA: FNAM(20) TYPE C,
          IDX      TYPE C.
        MOVE 1 TO IDX.
    LOOP AT ITAB.
    REFRESH IT_BDCDATA.
        PERFORM bdc_dynpro      USING 'SAPML080Z' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'V_T683V-KALSM(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=NEWL'.
        PERFORM bdc_dynpro      USING 'SAPML080Z' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'V_T683V-VKORG(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SAVE'.
        CONCATENATE 'V_T683V-KALSM(' IDX ')' INTO FNAM.
         PERFORM bdc_field       USING FNAM
                                       itab-kalsm.
        CONCATENATE 'V_T683V-KARTV(' IDX ')' INTO FNAM.
         PERFORM bdc_field       USING FNAM
                                       itab-kartv.
        CONCATENATE 'V_T683V-VKORG(' IDX ')' INTO FNAM.
         PERFORM bdc_field       USING FNAM
                                       itab-vkorg.
        CONCATENATE 'V_T683V-VTWEG(' IDX ')' INTO FNAM.
         PERFORM bdc_field       USING FNAM
                                       itab-vtweg.
        CONCATENATE 'V_T683V-SPART(' IDX ')' INTO FNAM.
         PERFORM bdc_field       USING FNAM
                                       itab-spart.
        CONCATENATE 'V_T683V-KALVG(' IDX ')' INTO FNAM.
         PERFORM bdc_field       USING FNAM
                                       itab-kalvg.
        CONCATENATE 'V_T683V-KALKS(' IDX ')' INTO FNAM.
         PERFORM bdc_field       USING FNAM
                                       itab-kalks.
    PERFORM bdc_dynpro      USING 'SAPLSTRD' '0300'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'KO008-TRKORR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=LOCK'.
       PERFORM bdc_field       USING 'KO008-TRKORR'
                                       'D47K919377'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'V_T683V-VKORG(01)'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'V_T683V-VKORG(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                       '=SAVE'.
    CALL TRANSACTION 'OVKK' USING IT_BDCDATA
                            MODE  'A'
                           UPDATE 'S'
                         MESSAGES INTO IT_BDCMSGCOLL.
    IDX = IDX + 1  .
    endloop.
    FORM BDC_DYNPRO USING PROG SCR.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-PROGRAM = PROG.
      IT_BDCDATA-DYNPRO  = SCR.
      IT_BDCDATA-DYNBEGIN = 'X'.
      APPEND IT_BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-FNAM = FNAM.
      IT_BDCDATA-FVAL  = FVAL.
      APPEND IT_BDCDATA.
    ENDFORM.
    I checked in debugging mode and found that data is passed to internal table but its not uploading data to OVKK, there no data is displayed.
    Please tell me solution for this.....
    regards,
    ravindra.

    Hi,
    Look at the following link you will find some good example of Table control.
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Here you need to take care to which line of table control you are populating the data.
    Make sure to take care of page down in table control.
    *********Try Call Transaction in MODE 'N'.
    Check your OK_CODE once again.
    Try to give BACk also after saving.
    The Table control is mainly used to update no.of line items at one shot. No need to come BACK for each and every record.
    Try to do recording in SHDB once again and see the changes closely.
    Thanks.
    If this helps you reward with points.
    Message was edited by: KDeepak
    Message was edited by: KDeepak

  • Need a script to import the data from flat file

    Hi Friends,
    Any one have any scripts to import the data from flat files into oracle database(Linux OS). I have to automate the script for every 30min to check any flat files in Incoming directory process them with out user interaction.
    Thanks.
    Srini

    Here is my init.ora file
    # $Header: init.ora 06-aug-98.10:24:40 atsukerm Exp $
    # Copyright (c) 1991, 1997, 1998 by Oracle Corporation
    # NAME
    # init.ora
    # FUNCTION
    # NOTES
    # MODIFIED
    # atsukerm 08/06/98 - fix for 8.1.
    # hpiao 06/05/97 - fix for 803
    # glavash 05/12/97 - add oracle_trace_enable comment
    # hpiao 04/22/97 - remove ifile=, events=, etc.
    # alingelb 09/19/94 - remove vms-specific stuff
    # dpawson 07/07/93 - add more comments regarded archive start
    # maporter 10/29/92 - Add vms_sga_use_gblpagfile=TRUE
    # jloaiza 03/07/92 - change ALPHA to BETA
    # danderso 02/26/92 - change db_block_cache_protect to dbblock_cache_p
    # ghallmar 02/03/92 - db_directory -> db_domain
    # maporter 01/12/92 - merge changes from branch 1.8.308.1
    # maporter 12/21/91 - bug 76493: Add control_files parameter
    # wbridge 12/03/91 - use of %c in archive format is discouraged
    # ghallmar 12/02/91 - add global_names=true, db_directory=us.acme.com
    # thayes 11/27/91 - Change default for cache_clone
    # jloaiza 08/13/91 - merge changes from branch 1.7.100.1
    # jloaiza 07/31/91 - add debug stuff
    # rlim 04/29/91 - removal of char_is_varchar2
    # Bridge 03/12/91 - log_allocation no longer exists
    # Wijaya 02/05/91 - remove obsolete parameters
    # Example INIT.ORA file
    # This file is provided by Oracle Corporation to help you customize
    # your RDBMS installation for your site. Important system parameters
    # are discussed, and example settings given.
    # Some parameter settings are generic to any size installation.
    # For parameters that require different values in different size
    # installations, three scenarios have been provided: SMALL, MEDIUM
    # and LARGE. Any parameter that needs to be tuned according to
    # installation size will have three settings, each one commented
    # according to installation size.
    # Use the following table to approximate the SGA size needed for the
    # three scenarious provided in this file:
    # -------Installation/Database Size------
    # SMALL MEDIUM LARGE
    # Block 2K 4500K 6800K 17000K
    # Size 4K 5500K 8800K 21000K
    # To set up a database that multiple instances will be using, place
    # all instance-specific parameters in one file, and then have all
    # of these files point to a master file using the IFILE command.
    # This way, when you change a public
    # parameter, it will automatically change on all instances. This is
    # necessary, since all instances must run with the same value for many
    # parameters. For example, if you choose to use private rollback segments,
    # these must be specified in different files, but since all gc_*
    # parameters must be the same on all instances, they should be in one file.
    # INSTRUCTIONS: Edit this file and the other INIT files it calls for
    # your site, either by using the values provided here or by providing
    # your own. Then place an IFILE= line into each instance-specific
    # INIT file that points at this file.
    # NOTE: Parameter values suggested in this file are based on conservative
    # estimates for computer memory availability. You should adjust values upward
    # for modern machines.
    # You may also consider using Database Configuration Assistant tool (DBCA)
    # to create INIT file and to size your initial set of tablespaces based
    # on the user input.
    # replace DEFAULT with your database name
    db_name=DEFAULT
    db_files = 80 # SMALL
    # db_files = 400 # MEDIUM
    # db_files = 1500 # LARGE
    db_file_multiblock_read_count = 8 # SMALL
    # db_file_multiblock_read_count = 16 # MEDIUM
    # db_file_multiblock_read_count = 32 # LARGE
    db_block_buffers = 100 # SMALL
    # db_block_buffers = 550 # MEDIUM
    # db_block_buffers = 3200 # LARGE
    shared_pool_size = 3500000 # SMALL
    # shared_pool_size = 5000000 # MEDIUM
    # shared_pool_size = 9000000 # LARGE
    log_checkpoint_interval = 10000
    processes = 50 # SMALL
    # processes = 100 # MEDIUM
    # processes = 200 # LARGE
    parallel_max_servers = 5 # SMALL
    # parallel_max_servers = 4 x (number of CPUs) # MEDIUM
    # parallel_max_servers = 4 x (number of CPUs) # LARGE
    log_buffer = 32768 # SMALL
    # log_buffer = 32768 # MEDIUM
    # log_buffer = 163840 # LARGE
    # audit_trail = true # if you want auditing
    # timed_statistics = true # if you want timed statistics
    max_dump_file_size = 10240 # limit trace file size to 5 Meg each
    # Uncommenting the line below will cause automatic archiving if archiving has
    # been enabled using ALTER DATABASE ARCHIVELOG.
    # log_archive_start = true
    # log_archive_dest = disk$rdbms:[oracle.archive]
    # log_archive_format = "T%TS%S.ARC"
    # If using private rollback segments, place lines of the following
    # form in each of your instance-specific init.ora files:
    # rollback_segments = (name1, name2)
    # If using public rollback segments, define how many
    # rollback segments each instance will pick up, using the formula
    # # of rollback segments = transactions / transactions_per_rollback_segment
    # In this example each instance will grab 40/5 = 8:
    # transactions = 40
    # transactions_per_rollback_segment = 5
    # Global Naming -- enforce that a dblink has same name as the db it connects to
    global_names = TRUE
    # Edit and uncomment the following line to provide the suffix that will be
    # appended to the db_name parameter (separated with a dot) and stored as the
    # global database name when a database is created. If your site uses
    # Internet Domain names for e-mail, then the part of your e-mail address after
    # the '@' is a good candidate for this parameter value.
    # db_domain = us.acme.com      # global database name is db_name.db_domain
    # FOR DEVELOPMENT ONLY, ALWAYS TRY TO USE SYSTEM BACKING STORE
    # vms_sga_use_gblpagfil = TRUE
    # FOR BETA RELEASE ONLY. Enable debugging modes. Note that these can
    # adversely affect performance. On some non-VMS ports the db_block_cache_*
    # debugging modes have a severe effect on performance.
    #_db_block_cache_protect = true # memory protect buffers
    #event = "10210 trace name context forever, level 2" # data block checking
    #event = "10211 trace name context forever, level 2" # index block checking
    #event = "10235 trace name context forever, level 1" # memory heap checking
    #event = "10049 trace name context forever, level 2" # memory protect cursors
    # define parallel server (multi-instance) parameters
    #ifile = ora_system:initps.ora
    # define two control files by default
    control_files = (ora_control1, ora_control2)
    # Uncomment the following line if you wish to enable the Oracle Trace product
    # to trace server activity. This enables scheduling of server collections
    # from the Oracle Enterprise Manager Console.
    # Also, if the oracle_trace_collection_name parameter is non-null,
    # every session will write to the named collection, as well as enabling you
    # to schedule future collections from the console.
    # oracle_trace_enable = TRUE
    # Uncomment the following line, if you want to use some of the new 8.1
    # features. Please remember that using them may require some downgrade
    # actions if you later decide to move back to 8.0.
    #compatible = 8.1.0
    Thanks.
    Srini

  • How to create the Export Data and Import Data using flat file interface

    Hi,
    Request to let me know based on the requirement below on how to export and import data using flat file interface.....
    Please provide the steps involved for the same.......
    BW/BI - Recovery Process for SNP data. 
    For each SNP InfoProvider,
    create:
    1) Export Data:
    1.a)  Create an export data source, InfoPackage, comm structure, etc. necessary to create an ASCII fixed length flat file on the XI
    ctnhsappdata\iface\SCPI063\Out folder for each SNP InfoProvider. 
    1.b)  All fields in each InfoProvider should be exported and included in the flat file. 
    1.c)  A process chain should be created for each InfoProvider with a start event. 
    1.d)  If the file exists on the target drive it should be overwritten. 
    1.e)  The exported data file name should include the InfoProvider technical name.
    1.f)  Include APO Planning Version, Date of Planning Run, APO Location, Calendar Year/Month, Material and BW Plant as selection criteria.
    2) Import Data:
    2.a) Create a flat file source system InfoPackage, comm structure, etc. necessary to import ASCII fixed length flat files from the XI
    ctnhsappdata\iface\SCPI063\Out folder for each SNP InfoProvider.
    2.b)  All fields for each InfoProvider should be mapped and imported from the flat file.
    2.c)  A process chain should be created for each InfoProvider with a start event. 
    2.d)  The file should be archived in the
    ctnhsappdata\iface\SCPI063\Archive directory.  Each file name should have the date appended in YYYYMMDD format.  Each file should be deleted from the \Out directory after it is archived. 
    Thanks in advance.
    Tyson

    Here's some info on working with plists:
    http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Introduc tion/chapter1_section1.html
    They can be edited with any text editor. Xcode provides a graphical editor for them - make sure to use the .plist extension so Xcode will recognize it.

  • Reading data from flat file Using TEXT_IO

    Dear Gurus
    I already posted this question but this time i need some other changes .....Sorry for that ..
    I am using 10G forms and using TEXT_IO for reading data from flat file ..
    My data is like this :-
    0|BP-V1|20100928|01|1|2430962.89|27|2430962.89|MUR|20100928120106
    9|2430962.89|000111111111|
    1|61304.88|000014104113|
    1|41961.73|000022096086|
    1|38475.65|000023640081|
    1|49749.34|000032133154|
    1|35572.46|000033093377|
    1|246671.01|000042148111|
    Here each column is separated by | . I want to read all the columns and want to do some validation .
    How can i do ?
    Initially my requirement was to read only 2 or 3 columns so i did like this ...
    Procedure Pay_Simulator(lfile_type varchar2,lac_no varchar2,lcur varchar2,lno_item number,ltotal number,ldate date,lpay_purp varchar2,lfile_name varchar2)
    IS
    v_handle utl_file.file_type;
    v_filebuffer varchar2(500);
    line_0_date VARCHAR2 (10);
    line_0_Purp VARCHAR2 (10);
    line_0_count Number;
    line_0_sum number(12,2);
    line_0_ccy Varchar2(3);
    line_9_sum Number(12,2);
    line_9_Acc_no Varchar2(12);
    Line_1_Sum Number(12,2);
    Line_1_tot Number(15,2) := 0;
    Line_1_flag Number := 0;
    lval number;
    lacno varchar2(16);
    v_file varchar2(20);
    v_path varchar2(50);
    Begin
    v_file := mcb_simulator_pkg.GET_FILENAME(lfile_name); -- For the file name
    v_path :=rtrim(regexp_substr( lfile_name , '.*\\' ),'\'); For the Path
    v_path := SUBSTR (lfile_name,0, INSTR (lfile_name, '\', -1));
    v_handle := UTL_FILE.fopen (v_path, v_file, 'r');
    LOOP
    UTL_FILE.get_line (v_handle, v_filebuffer);
    IF SUBSTR (v_filebuffer, 0, 1) = '0' THEN
    SELECT line_0 INTO line_0_date
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    SELECT line_0 INTO line_0_Purp
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 4;
    SELECT line_0 INTO line_0_count
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 7;
    SELECT line_0 INTO line_0_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 8;
    SELECT line_0 INTO line_0_ccy
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 9;
    ELSIF SUBSTR (v_filebuffer, 0, 1) = '9' THEN
    SELECT line_9 INTO line_9_Acc_no
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_9, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    SELECT line_9 INTO line_9_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_9, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 2;
    ELSIF SUBSTR (v_filebuffer, 0, 1) = '1' THEN
    line_1_flag := line_1_flag+1;
    SELECT line_1 INTO line_1_sum
    FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_1, ROWNUM rn
    FROM DUAL
    CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
    WHERE rn = 3;
    Line_1_tot := Line_1_tot + line_1_sum;
    END IF;
    END LOOP;
    DBMS_OUTPUT.put_line (Line_1_tot);
    DBMS_OUTPUT.PUT_LINE (Line_1_flag);
    UTL_FILE.fclose (v_handle);
    END;
    But now how can i do ? Shall i use like this select Statement for all the columns ?

    Sorry for that ..
    As per our requirement ...
    I need to read the flat file and it looks like like this .
    *0|BP-V1|20100928|01|1|2430962.89|9|2430962.89|MUR|20100928120106*
    *9|2430962.89|000111111111|*
    *1|61304.88|000014104113|*
    *1|41961.73|000022096086|*
    *1|38475.65|000023640081|*
    *1|49749.34|000032133154|*
    *1|35572.46|000033093377|*
    *1|246671.01|000042148111|*
    *1|120737.25|000053101979|*
    *1|151898.79|000082139768|*
    *1|84182.34|000082485593|*
    I have to check the file :-
    Validation are 1st line should start from 0 else it should raise an error and insert that error into one table .
    The for 2nd line also same thing ..it should start from 9 else it should raise an error and insert that error into one table .
    Then the 3rd line should start from 1 else it should raise an error and insert that error into one table .
    After that i have to do a validation like i will read the 1st line 2nd column .. It should be like this BP-V1 else raise an error and insert that error to a table . Then i will check the 3rd column which is 20100928 , it should be YYYYMMDD format else same thing ERROR.
    Then like this for all columns i have different validation .......
    Then it will check for the 2nd line 3rd column . this is an account no .1st i will check it should be 12 char else ERROR .Then I will check that what user has imputed in the form.Like for example User putted 111111111 then i will check with this 000111111111 which is there in the 2nd line . I have to add 000 before that Account no which user imputed .
    Then the lines which is starting from 1 , i have to take all the 2nd column for all the lines which is starting from 1 and i have to do a sum . After that i have to compare that sum with the value in the 1st lines ( Starting from 0) 6th column . It should be same else ERROR ...
    Then same way i have to count all the lines which is starting from 1 . Then i have to compare with the 7th column of 1st line . It should be same . Here in this file it should be 9.
    MY CODE IS :-
    Procedure Pay_Simulator(lfile_type varchar2,lac_no varchar2,lcur varchar2,lno_item number,ltotal number,ldate date,lpay_purp varchar2,lfile_name varchar2)
    IS
    v_handle TEXT_IO.file_type;
    v_filebuffer varchar2(500);
    line_0_date VARCHAR2 (10);
    line_0_Purp VARCHAR2 (10);
    line_0_count Number;
    line_0_sum number(12,2);
    line_0_ccy Varchar2(3);
    line_9_sum Number(12,2);
    line_9_Acc_no Varchar2(12);
    Line_1_Sum Number(12,2);
    Line_1_tot Number(15,2) := 0;
    Line_1_flag Number := 0;
    lval number;
    lacno varchar2(16);
    v_file varchar2(20);
    v_path varchar2(50);
    LC$String VARCHAR2(50) ;--:= 'one|two|three|four|five|six|seven' ;
    LC$Token VARCHAR2(100) ;
    i PLS_INTEGER := 2 ;
    lfirst_char number;
    lvalue Varchar2(100) ;
    Begin
    v_file := mcb_simulator_pkg.GET_FILENAME(lfile_name); For the file name
    v_path :=rtrim(regexp_substr( lfile_name , '.*\\' ),'\'); For the Path
    --v_path := SUBSTR (lfile_name,0, INSTR (lfile_name, '\', -1));
    Message(lfile_name);
    v_handle := TEXT_IO.fopen(lfile_name, 'r');
              BEGIN
                        LOOP
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        --Message('First Char '||lfirst_char); 
                                  IF lfirst_char = '0' Then
                                  Loop
                                  LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                                  Message('VAL - '||LC$Token);
                                  lvalue := LC$Token;
                                  EXIT WHEN LC$Token IS NULL ;
    i := i + 1 ;
    End Loop;
                                  Else
                                       Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (9999,'0002','First line should always start with 0');
                                       Forms_DDL('Commit');
                                       raise form_Trigger_failure;
                                  End if ;
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                        --Message('Row '||LC$Token);
                             IF lfirst_char = '9' Then
                                  Null;
                             Else
                                  Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (8888,'0016','Second line should start with 9');
                                  Forms_DDL('Commit');
                                  raise form_Trigger_failure;
                             End IF;
                        LOOP
                        TEXT_IO.get_line (v_handle, v_filebuffer);
                        lfirst_char := Substr(v_filebuffer,0,1);
                        LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
                        --Message('Row '||LC$Token);
                                  IF lfirst_char = '1' Then
                                  Null;
                                  Else
                                       Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (7777,'0022','The third line onward should start with 1');
                                       Forms_DDL('Commit');
                                       raise form_Trigger_failure;
                                  End if;
                        END LOOP;
                        --END IF;
                        END LOOP;
              EXCEPTION
                   When No_Data_Found Then
              TEXT_IO.fclose (v_handle);
              END;
    Exception
         When Others Then
         Message('Other error');
    END;
    I am calling the FUNCTION which you gave SPLIT as mcb_simulator_pkg.Split.

  • Loading data from flat file...

    Hello,
    I am actually experiencing a problem where I cant load data from a flat file into a table. I have actually reverse engineered the flat file into ODI. But the thing is I don't know how to load the data that is reversed into a RDBMS table. Added, I don't know how create this RDBMS table form within ODI to be reflected on the DB. Added, don't know how to load the data from the flat file onto this table without having to add the columns in order to map between the flat file and the table.
    In conclusion, I need to know how to create an RDBMS table from within ODI on the database. And how to automatically map the flat file to the DB table and load the data into the DB table.
    Regards,
    Hossam

    Hi Hossam,
    We can used ODI procedure to create table in the DB.
    Make sure you keep the column name in the table name same as the column name in FLAT FILE so that it can automatically map the column.
    and regarding Loading data from FLAT File i.e. our source table is FLAT FILE till ODI 10.1.3.4 we need to manually insert the datastore since the file system cannot be reversed.
    Please let me know Hossam if i can assis you further.
    Thanks and Regards,
    Andy

  • Loading transaction data from flat file to SNP order series objects

    Hi,
    I am an BW developer and i need to provide data to my SNP team.
    Can you please let me know more about <b>loading transaction data (sales order, purchase order, etc.,) from external systems into order based SNP objects/structure</b>. there is a 3rd party tool called webconnect that gets data from external systems and can give data in flat file or in database tables what ever required format we want.
    I know we can use BAPI's, but dont know how. can you please send any <b>sample ABAP program code that calls BAPI to read flat file and write to SNP order series objects</b>.
    Please let me know ASAP, how to get data from flat file into SNP order based objects, with options and I will be very grateful.
    thanks in advance
    Rahul

    Hi,
    Please go through the following links:
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4180456
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4040057
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=3832922
    https://forums.sdn.sap.com/click.jspa?searchID=6094493&messageID=4067999
    Hope this helps...
    Regards,
    Habeeb
    Assign points if helpful..:)

  • Import data from excel file - best practice in the CQ?

    Hi,
    I have question related to importing data from excel file and creates from those data a table in the CQ page. Is inside CQ some OOTB component which provides this kind of functionalities? Maybe somebody implement this kind of functionality or there is best practice to do this kind of functionalities?
    Thanks in advance for any answer,
    Regards
    kasq

    You can check a working example package [1] (use your Adobe ID to log in)
    After installing it, go to [2] for immediate example.
    Unfortunately it only supports the old OLE-2 Excel format (.xls and not .xlsx)
    [1] - http://dev.day.com/content/packageshare/packages/public/day/cq540/demo/xlstable.html
    [2] - http://localhost:4502/cf#/content/geometrixx/en/company/news/pressreleases/my_personal_bes ts.html

  • Reading data from flat file in aplication server

    hi all,
    can any body provide code how to read data from flat file which is in application server.
    thanks in advance

    hi,
    chk this sample code.
    parameters: p_file like rlgrap-filename obligatory
    default '/usr/sap/upload.xls'.
    types: begin of t_data,
    vbeln like vbap-vbeln,
    posnr like vbap-posnr,
    matnr like vbap-matnr,
    werks like vbap-werks,
    megne like vbap-zmeng,
    end of t_data.
    data: it_data type standard table of t_data,
    wa_data type t_data.
    open dataset p_file for output in text mode encoding default.
    if sy-subrc ne 0.
    write:/ 'Unable to open file:', p_file.
    else.
    do.
    read dataset p_file into wa_data.
    if sy-subrc ne 0.
    exit.
    else.
    append wa_data to it_data.
    endif.
    enddo.
    close dataset p_file.
    endif.
    Rgds
    Anver

  • Wrong century for the dates from flat file

    I am in the process of uploading the data from flat file ( aka CSV) into oracle via external table .
    All the dates have the year of 20xx. My understanding was 51-99 will be prefixed with 19 ( such as 1951 - 1999) and 00-50
    will be prefixed with 20 ( such as 2004 ... )
    The column below ( startdate ) is of timestamp .
    Is my understanding wrong ?
    SQL> select startdate , to_date(startdate , 'dd/mm/yyyy' ) newdate from tab;
    NEW_DATE STARTDATE
    09/18/2090 18-SEP-90 12.00.00.000000000 AM
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for 64-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    SQL> show parameter nls
    NAME TYPE VALUE
    nls_calendar string
    nls_comp string BINARY
    nls_currency string
    nls_date_format string
    nls_date_language string
    nls_dual_currency string
    nls_iso_currency string
    nls_language string AMERICAN
    nls_length_semantics string BYTE
    nls_nchar_conv_excp string FALSE
    nls_numeric_characters string
    nls_sort string
    nls_territory string AMERICA
    nls_time_format string
    nls_time_tz_format string
    nls_timestamp_format string
    nls_timestamp_tz_format string
    SQL>
    SQL>

    Offense . None taken ...
    I literally typed the sql ( as I did not copy & paste SQL / resultsets ) . I did use to_char in my original sql . I don't want to expose the real table . thats why I was giving the made up test case. If you carefully the SQL and the equivalent result sets ... you would have noticed .
    Here is the SQL used ( of course , I have changed the table name ) ...
    select to_char(startdate , 'mm/dd/yyyy') sdate, startdate from t
    SDATE STARTDATE
    09/18/2090 18-SEP-90 12.00.00.000000 AM
    The flatfile had the value of 091890 as the data .

Maybe you are looking for

  • Black screen on starting X in Virtualbox guest

    Hi Arch Linux, I am running Arch linux as a Virtualbox 4.2.6 guest with a Windows 7 host. I have virtualbox-guest-utils 4.2.6-1 installed. When I run "startx" or "xinit" my screen goes black and freezes up. The VM seems totally unresponsive, I can't

  • Want to create a multiple Purchase Order using one file source

    I'm want to create a multiple purchase order using one source file. I want to read the file source create LINES in a purchase order and when the Vendor code changes I want to Add the purchase order and then create a new purchase order and Add LINES a

  • Text in Flash Player looks crap only on my computer

    Hi there, i have a news section on my website (not yet live) that has been designed in flash. The rest of the text on the site is in HTML. The text in the flash section looks really bad on my screen. Some of the text is thick and blurry and some is t

  • IPhoto will not open normally - hangs up

    When I try to open iPhoto, it hangs and will not open. I can go in the "back door" by choosing a photo and selecting "open with" and iPhoto, but the application won't open normally. I got my new laptop last December and migrated my applications, etc.

  • Rescheduling dependency on plant or stor loc.

    Is the Rescheduling plant or storage location dependant ? So if we have stock in SE01 L010 but not in L001 will rescheduling , as it is configured for SE today , allocate stock that it thinks is available to orders ?