Dynamically generating flat file using OWB10gr2

Hi,
I am trying to generated an XML file using OWB10gR2.
It is achievable to create a predefined file ie with static name or add sysdate into the file name,but can we name the file depending on the Request Id which can be provided as an Input to the mapping.
Any suggestions will be helpful.
Regards,
PHD.

You can define expressions which you might be able to be creative with;
http://blogs.oracle.com/warehousebuilder/2007/07/dynamically_generating_target.html
Cheers
David

Similar Messages

  • Dynamically changing flat file target location in OWB10gr2.

    Hi,
    We have a requirement where in we are suppose to load a flat file from relational tables and the location of the flat file needs to be configurable at runtime.
    Please suggest if this is achievable.
    Regards,
    PHD
    Edited by: user1662077 on Jun 17, 2009 10:08 PM

    See the post here for dynamically generating target file names using the OWB file operator as a target;
    http://blogs.oracle.com/warehousebuilder/2007/07/dynamically_generating_target.html
    Other techniques also include using a table function as a target.
    Cheers
    David

  • Problem in dynamically generating the file upload field

    Hello all
    I am using netbeans 5.5 and visualwebpack for my jsf project.
    i have a problem in dynamically generating the file upload field and using it.
    I have a panel say "panelA" which holds file upload fields.
    Depending upon the count value i generate the file upload field using following code snippet:
    Upload upload1 = new Upload();
    upload1.setId("upload1");
    getPanelA.getChildren().add(upload1);
    The page successfully shows up the file upload fields. While the user clicks the submit button, i have used following logic to perform upload:
    List components = getPanelA().getChildren();
    for(int i = 0; i<components.size(); i++){
    if(components.get(i) instanceof Upload){
    UploadedFile uploadedFile = ((Upload)components.get(i)).getUploadedFile();
    I am getting this UploadedFile object null.
    How can i solve this problem.

    Anyway,
    I solved the problem.
    Actually i was using label property of the upload field due to which i got null pointer exception.
    I removed the label property of the upload field and things worked as i wanted.

  • Help - Generate pdf files using creator  - plz

    Hello im trying to dynamically generate pdf file and show it on screen but im stuck, i've used itext, but i can make it work, anyone can share his own experience about generating pdf files and viewing on browser at same time using Creator?
    TNKS in advance!

    Hi there,
    Im not sure but the link in this thread might help
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=106715
    K

  • DB2 Version 8 to Flat Files using ODI

    Hi,
    We are trying to load data from DB2 V8 to flat files using ODI.
    Can anybody help me in this to configure server in Topology.
    Thanks
    Ashwini

    Hi,
    How are you? Let me try contribute a little...
    A)
    1) The OS isn't a problem, once you link it at topology will be OK.
    2) If you have a fix name just create a datastore to it, if not, there are techniques to got dynamic file names
    3) When you say "*.dat, *.cvs" maybe you refer to the internal format of file (record separator, decimal point, etc) all of this is configurable on datastore that represents the file at ODI.
    B) Yes, the only requisite is to have the write and read rights.
    C) The most simple way is create a refresh variable that get the data in any format you wish..
    Does it make any sense to you?
    Cezar Santos

  • Delete data from a flat file using PL/SQL -- Please help.. urgent

    Hi All,
    We are writing data to a flat file using Text_IO.Put_Line command. We want to delete data / record from that file after data is written onto it.
    Please let us know if this is possible.
    Thanks in advance.
    Vaishali

    There's nothing in UTL_FILE to do this, so your options are either to write a Java stored procedure to do it or to use whatever mechanism the host operating system supports for editing files.
    Alternatively, you could write a PL/SQL procedure to read each line in from the file and then write them out to a second file, discarding the line you don't want along the way.

  • Writing to a flat file using UTL in a procedure

    Hello All,
    I am creating a procedure in which I am trying to write data to a flat file using UTL. Code is shown below:
    CREATE OR REPLACE PROCEDURE wrt_lifungduty IS
       sql_stmt             varchar2(200);
       sql_stmt1            varchar2(200);
       sql_stmt2            varchar2(200);
       v_cur_hdl            integer;
       v_rows_processed     BINARY_INTEGER;
       V_file           UTL_FILE.FILE_TYPE;
       V_flatfile_line      VARCHAR2(98) := NULL;
      V_OBLIGATION_KEY    NUMBER(10);
      V_OBLIGATION_LEVEL  VARCHAR2(6);
      V_KEY_VALUE_1       VARCHAR2(20);
      V_KEY_VALUE_2       VARCHAR2(20);
      V_PARTNER_TYPE      VARCHAR2(6);
      V_PARTNER_ID        VARCHAR2(10);
      V_EXT_INVC_NO       VARCHAR2(30);
      V_EXT_INVC_DATE     DATE;
      V_PAID_DATE         DATE;
      V_PAID_AMT          NUMBER(20,4);
      V_COMP_ID           VARCHAR2(10);
      V_RECEIPT_DATE      DATE;
      V_ORDER_QTY         NUMBER(12,4);
      V_RECEIPT_QTY       NUMBER(12,4);
      V_FRT               NUMBER;
      V_DUTY              NUMBER;
      V_SUPPLIER          NUMBER;
      V_FLAG              VARCHAR2(1);
      V_ELC_COST          NUMBER;
      V_ADJ_ELC           NUMBER;
    Cursor x is
          select OBLIGATION_KEY,OBLIGATION_LEVEL,KEY_VALUE_1,KEY_VALUE_2,PARTNER_TYPE,PARTNER_ID,EXT_INVC_NO,EXT_INVC_DATE
                 ,PAID_DATE,PAID_AMT,COMP_ID,RECEIPT_DATE,ORDER_QTY,RECEIPT_QTY,FRT,DUTY,SUPPLIER,FLAG,ELC_COST,ADJ_ELC
          from RMSBIZ.CT_ANALYZE_LIFUNG_DUTY;    
    BEGIN
    if not UTL_FILE.IS_OPEN(V_file) then
          V_file := UTL_FILE.FOPEN('/exchange/biz/rms2lan','sb_duty.dat','w'); --need to give the location for testing
       end if;
    for x1 in x loop
      V_OBLIGATION_KEY    :=1;
      V_OBLIGATION_LEVEL  :='test';
      V_OBLIGATION_KEY    :=x1.OBLIGATION_KEY;
      V_OBLIGATION_LEVEL  :=x1.OBLIGATION_LEVEL;
      V_KEY_VALUE_1       :=x1.KEY_VALUE_1;
      V_KEY_VALUE_2       :=x1.KEY_VALUE_2;
      V_PARTNER_TYPE      :=x1.PARTNER_TYPE;
      V_PARTNER_ID        :=x1.PARTNER_ID;
      V_EXT_INVC_NO       :=x1.EXT_INVC_NO;
      V_EXT_INVC_DATE     :=x1.EXT_INVC_DATE;
      V_PAID_DATE         :=x1.PAID_DATE;
      V_PAID_AMT          :=x1.PAID_AMT;
      V_COMP_ID           :=x1.COMP_ID;
      V_RECEIPT_DATE      :=x1.RECEIPT_DATE;
      V_ORDER_QTY         :=x1.ORDER_QTY;
      V_RECEIPT_QTY       :=x1.RECEIPT_QTY;
      V_FRT               :=x1.FRT;
      V_DUTY              :=x1.DUTY;
      V_SUPPLIER          :=x1.SUPPLIER;
      V_FLAG              :=x1.FLAG;
      V_ELC_COST          :=x1.ELC_COST;
      V_ADJ_ELC           :=x1.ADJ_ELC;
      V_flatfile_line:=  V_OBLIGATION_KEY||','||
      V_OBLIGATION_LEVEL  ||','||
      V_KEY_VALUE_1       ||','||
      V_KEY_VALUE_2       ||','||
      V_PARTNER_TYPE      ||','||
      V_PARTNER_ID        ||','||
      V_EXT_INVC_NO       ||','||
      V_EXT_INVC_DATE     ||','||
      V_PAID_DATE         ||','||
      V_PAID_AMT          ||','||
      V_COMP_ID           ||','||
      V_RECEIPT_DATE      ||','||
      V_ORDER_QTY         ||','||
      V_RECEIPT_QTY       ||','||
      V_FRT               ||','||
      V_DUTY              ||','||
      V_SUPPLIER          ||','||
      V_FLAG              ||','||
      V_ELC_COST          ||','||
      V_ADJ_ELC;
    V_flatfile_line:= V_OBLIGATION_KEY||','|| V_OBLIGATION_LEVEL;
        UTL_FILE.PUT_LINE(V_file, V_flatfile_line);
    end loop
      commit;
       UTL_FILE.fclose(V_file); 
    END;
                Getting the following errors:
    SQL>Welcome-->
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "SYS.UTL_FILE", line 98
    ORA-06512: at "SYS.UTL_FILE", line 157
    ORA-06512: at "RMSBIZ.WRT_LIFUNGDUTY", line 39
    ORA-06512: at line 1
    SQL>Welcome-->39
    39* V_file := UTL_FILE.FOPEN('/exchange/biz/rms2lan','sb_duty.dat','w');
    SQL>Welcome-->
    Does any one know why it is erroring out?
    Thanks,
    Chiru

    the code below works if i take out the last 3 columns while writing to the flat file line.
    CREATE OR REPLACE PROCEDURE wrt_lifungduty IS
       sql_stmt             varchar2(200);
       sql_stmt1            varchar2(200);
       sql_stmt2            varchar2(200);
       v_cur_hdl            integer;
       v_rows_processed     BINARY_INTEGER;
       V_file           UTL_FILE.FILE_TYPE;
       V_flatfile_line      VARCHAR2(98) := NULL;
      V_OBLIGATION_KEY    NUMBER(10);
      V_OBLIGATION_LEVEL  VARCHAR2(6);
      V_KEY_VALUE_1       VARCHAR2(20);
      V_KEY_VALUE_2       VARCHAR2(20);
      V_PARTNER_TYPE      VARCHAR2(6);
      V_PARTNER_ID        VARCHAR2(10);
      V_EXT_INVC_NO       VARCHAR2(30);
      V_EXT_INVC_DATE     DATE;
      V_PAID_DATE         DATE;
      V_PAID_AMT          NUMBER(20,4);
      V_COMP_ID           VARCHAR2(10);
      V_RECEIPT_DATE      DATE;
      V_ORDER_QTY         NUMBER(12,4);
      V_RECEIPT_QTY       NUMBER(12,4);
      V_FRT               NUMBER;
      V_DUTY              NUMBER;
      V_SUPPLIER          NUMBER;
      V_FLAG              VARCHAR2(1);
      V_ELC_COST          VARCHAR2(20);
      V_ADJ_ELC           VARCHAR2(20);
    Cursor x is
          select OBLIGATION_KEY,OBLIGATION_LEVEL,KEY_VALUE_1,KEY_VALUE_2,PARTNER_TYPE,PARTNER_ID,EXT_INVC_NO,EXT_INVC_DATE
                 ,PAID_DATE,PAID_AMT,COMP_ID,RECEIPT_DATE,ORDER_QTY,RECEIPT_QTY,FRT,DUTY,SUPPLIER,FLAG,ELC_COST,ADJ_ELC
          from RMSBIZ.CT_ANALYZE_LIFUNG_DUTY;
    BEGIN
    if not UTL_FILE.IS_OPEN(V_file) then
          V_file := UTL_FILE.FOPEN('/rmsapps/rms803/biz/data/utl_files','sb_duty.csv','w'); --need to give the location for testing
       end if;
    for x1 in x loop
      V_OBLIGATION_KEY    :=nvl(x1.OBLIGATION_KEY,null);
      V_OBLIGATION_LEVEL  :=nvl(x1.OBLIGATION_LEVEL,null);
      V_KEY_VALUE_1       :=x1.KEY_VALUE_1;
      V_KEY_VALUE_2       :=x1.KEY_VALUE_2;
      V_PARTNER_TYPE      :=x1.PARTNER_TYPE;
      V_PARTNER_ID        :=x1.PARTNER_ID;
      V_EXT_INVC_NO       :=x1.EXT_INVC_NO;
      V_EXT_INVC_DATE     :=x1.EXT_INVC_DATE;
      V_PAID_DATE         :=x1.PAID_DATE;
      V_PAID_AMT          :=x1.PAID_AMT;
      V_COMP_ID           :=x1.COMP_ID;
      V_RECEIPT_DATE      :=x1.RECEIPT_DATE;
      V_ORDER_QTY         :=x1.ORDER_QTY;
      V_RECEIPT_QTY       :=x1.RECEIPT_QTY;
      V_FRT               :=x1.FRT;
      V_DUTY              :=x1.DUTY;
      V_SUPPLIER          :=x1.SUPPLIER;
      V_FLAG              :=nvl(x1.FLAG,'0');
      V_ELC_COST          :=to_char(nvl(x1.ELC_COST,0));
      V_ADJ_ELC           :=to_char(nvl(x1.ADJ_ELC,0));
      V_flatfile_line:=  V_OBLIGATION_KEY||','||
      V_OBLIGATION_LEVEL  ||','||
      V_KEY_VALUE_1       ||','||
      V_KEY_VALUE_2       ||','||
      V_PARTNER_TYPE      ||','||
      V_PARTNER_ID        ||','||
      V_EXT_INVC_NO       ||','||
      V_EXT_INVC_DATE     ||','||
      V_PAID_DATE         ||','||
      V_PAID_AMT          ||','||
      V_COMP_ID           ||','||
      V_RECEIPT_DATE      ||','||
      V_ORDER_QTY         ||','||
      V_RECEIPT_QTY       ||','||
      V_FRT               ||','||
      V_DUTY              ||','||
      V_SUPPLIER          ||','||
    -- V_FLAG            ||','||
      V_ELC_COST          ||','||
      V_ADJ_ELC;
        UTL_FILE.PUT_LINE(V_file, V_flatfile_line);
    end loop
      commit;
       UTL_FILE.fclose(V_file);
    EXCEPTION
      WHEN UTL_FILE.INVALID_PATH
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INVALID_PATH');
      WHEN UTL_FILE.INVALID_MODE
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INVALID_MODE');
      WHEN UTL_FILE.INVALID_FILEHANDLE
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INVALID_FILEHANDLE');
      WHEN UTL_FILE.INVALID_OPERATION
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INVALID_OPERATION');
      WHEN UTL_FILE.READ_ERROR
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: READ_ERROR');
      WHEN UTL_FILE.WRITE_ERROR
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: WRITE_ERROR');
      WHEN UTL_FILE.INTERNAL_ERROR
      THEN
          DBMS_OUTPUT.PUT_LINE ('error: INTERNAL_ERROR');
      WHEN OTHERS THEN
         --     v_error_code := SQLCODE;
    --          v_error_message := SQLERRM;
    --         dbms_output.put_line('ERROR: '||v_error_code);
       --       dbms_output.put_line('ERROR: '||v_error_message);
              RAISE_APPLICATION_ERROR(-20003,'sbduty - aborted');  
    END;
    /It fails as soon as it encounters the V_FLAG in the V_flat_file_line. The data in the table has nulls for the FLAG, and some -ve numbers for the ELC_COST,ADJ_ELC..but that should'nt cause any problems does it?
    Whats wrong with those 3 columns?
    Errors that i get are:
    SQL>Welcome-->BEGIN wrt_lifungduty; END;
    ERROR at line 1:
    ORA-20003: sbduty - aborted
    ORA-06512: at "RMSBIZ.WRT_LIFUNGDUTY", line 117
    ORA-06512: at line 1
    SQL>Welcome-->117
    117* RAISE_APPLICATION_ERROR(-20003,'sbduty - aborted');
    SQL>Welcome-->
    Thanks,
    Chiru

  • How to get field separator in flat file using GUI_DOWNLOAD function

    hi,
    how to get field separator in flat file using GUI_DOWNLOAD function.
                                    thanking you.

    Hi,
      Use WRITE_FIELD_SEPARATOR = 'X'.
      Check this sample code
    REPORT  z_file_download.
    DATA: w_name(90) TYPE c.
    DATA:
      BEGIN OF fs_flight,
        carrid   LIKE sflight-carrid,
        connid   LIKE sflight-connid,
        fldate   LIKE sflight-fldate,
        price    LIKE sflight-price,
        currency LIKE sflight-currency,
      END OF fs_flight.
    DATA:
      BEGIN OF fs_head,
        carrid(10) TYPE c,
        connid(10) TYPE c,
        fldate(10) TYPE c,
        price(10) TYPE c,
        curr(10) TYPE c,
      END OF fs_head.
    DATA:
      t_head LIKE
       TABLE OF
             fs_head.
    DATA:
      t_flight LIKE
         TABLE OF
               fs_flight.
    fs_head-carrid = 'CARRID'.
    fs_head-connid = 'CONNID'.
    fs_head-fldate = 'FLDATE'.
    fs_head-price  = 'PRICE'.
    fs_head-curr   = 'CURRENCY'.
    APPEND fs_head TO t_head.
    SELECT-OPTIONS:
      s_carrid FOR fs_flight-carrid.
    START-OF-SELECTION.
      SELECT carrid
             connid
             fldate
             price
             currency
        FROM sflight
        INTO TABLE t_flight
       WHERE carrid IN s_carrid.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                  =
        filename                      = 'D:\flight.xls'
       FILETYPE                      = 'ASC'
    *   APPEND                        = ' '
        WRITE_FIELD_SEPARATOR         = 'X'
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    *   CONFIRM_OVERWRITE             = ' '
    *   NO_AUTH_CHECK                 = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   WRITE_BOM                     = ' '
    * IMPORTING
    *   FILELENGTH                    =
      tables
        data_tab                      = t_head
    EXCEPTIONS
       FILE_WRITE_ERROR              = 1
       NO_BATCH                      = 2
       GUI_REFUSE_FILETRANSFER       = 3
       INVALID_TYPE                  = 4
       NO_AUTHORITY                  = 5
       UNKNOWN_ERROR                 = 6
       HEADER_NOT_ALLOWED            = 7
       SEPARATOR_NOT_ALLOWED         = 8
       FILESIZE_NOT_ALLOWED          = 9
       HEADER_TOO_LONG               = 10
       DP_ERROR_CREATE               = 11
       DP_ERROR_SEND                 = 12
       DP_ERROR_WRITE                = 13
       UNKNOWN_DP_ERROR              = 14
       ACCESS_DENIED                 = 15
       DP_OUT_OF_MEMORY              = 16
       DISK_FULL                     = 17
       DP_TIMEOUT                    = 18
       FILE_NOT_FOUND                = 19
       DATAPROVIDER_EXCEPTION        = 20
       CONTROL_FLUSH_ERROR           = 21
       OTHERS                        = 22
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'D:\flight.xls'
          filetype                = 'ASC'
          append                  = 'X'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_flight
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc EQ 0.
        MESSAGE 'Download successful' TYPE 'I'.
      ENDIF.
      IF sy-subrc <> 0.
    *  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • How to Create a Flat File using FTP/File Adapter

    Can any body done workaround on creating the Flat file using FTP/File Adapter?.
    I need to create a simple FlatFile either using of delimiter/Fixed length. using the above said adapters we can create XML file, i tried concatinating all the values into a single String and writing into a file, but it does not have proper structure
    Can any body help me out on this..
    Thanks
    Ram

    You can create a text schema while creating a File Adapter. If schema is specified for File Adapter, it takes care of converting XML into fixed length or delimited format.
    Thanks,
    -Ng.

  • Idoc to flat file using Integration process does not show up at all

    Hello All,
    I created a scenario IDOC to Flat File using Integration Process and one without IntegrationProcess. I am able to execute the one without Integration Process easily.
    However when I send the IDOC from SAP then the Integration Process scenario just does not work.
    I Checked SXMB_MONI  There is no entry for the Integration Process.I can see entry for other without Integration Process.
    SXI_CACHE : I can see my Integration Process active
    SWEQADM :  I have activated the Event Queue and Background job
    SWF_XI_ADM_BPE :  ALL BPE is showing green status.
    All syntax check on IP are fine.
    There is no Basis Help for me so  there could be some additional basis steps which need to be configured.  Has anyone faced such an issue with Integration Process?
    Regards
    Prashanta

    Hope this might help you. when u configure an IDoc as Sender with BPM this is how you proceed.
    <b>1<b>. let us split the scenario into two</b>.</b>
    a. <b>Sender to BPM</b> ( Integration Process).
    b. <b>BPM to Receiver</b>.
    <b>2. First let us configure the first Sender to BPM.</b>
    a. Sender Agreement( <b>Not required</b> ).
    b. Receiver Agreement( <b>NOT Required</b>).
    c. Receiver Determination( Sender Service, Outbound Interface, Receiver Service(<b>Integration Process</b>).
    d. Interface Determination( Inbound Interface(Sender Abstract Interface), Message Mapping(NOT Required if your using transformation stepin Integration Process)).
    <b>3. Now let us configure the Second BPM to Receiver.</b>
    a. Sender Agreement( <b>NOT Required</b>)
    b. Receiver Agreement( Sender Service(<b>Integration process</b>), Receiver Abstarct Interface,Receiver service, Inbound Interface).
    c. Receiver Determination( Sender Service(Integration Process), Receiver Abstarct Interface,Receiver Service).
    d. Interface Determination( Inbound Interface, Message Mapping(<b>NOT Required</b>)).
    So Finally we have <b>One Receiver Agreement</b>, <b>Two Receiver Determinations</b>, <b>Two Interface Determinations</b>.
    Please let me know if you have any more queries.
    Regards
    Gopi

  • How to extract data from Essbase to Flat File using ODI

    Hi,
    Anyone know how to extract data from Essbase to Flat File using ODI?
    Thanks in advance.
    Regards,
    Sumardi

    Hi,
    Have you read through :-
    Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
    Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
    If you have read them and are still have a problem at what stage are you having the issues?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Generating text file using PL/SQL

    can any body send sample program how to generate text file using PL/SQL program.I want to store table data into that text file.

    Hi,
    try this.
    Thanks
    CREATE OR REPLACE procedure write_index (TABLE_NAME_ACCEPT VARCHAR2) IS
    id UTL_FILE.FILE_TYPE;
    name VARCHAR2(20) := 'e:\db_coca\input';      
    err VARCHAR2(100);      
    ColNameLength Integer;
    NumberoFColumns Integer;
    num NUMBER;           
    i integer;
    loc_query VARCHAR2(2000);
    cursor_name INTEGER;
    ret INTEGER;
    l_const_name VARCHAR2(30);
    CURSOR c_columns(i_Constraint_name VARCHAR2) IS
         SELECT *
         FROM     all_cons_columns
         WHERE     CONSTRAINT_NAME = i_Constraint_name
         order by table_name;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('BEFORe OPEN');
    --id := UTL_FILE.FOPEN('e:\db_coca\input',name,'w');          
         --IF UTL_FILE.IS_OPEN(id) THEN
         --     DBMS_OUTPUT.PUT_LINE('Opened');
         --ELSE
         --     DBMS_OUTPUT.PUT_LINE('Still Closed');           
         --END IF;          
    DBMS_OUTPUT.PUT_LINE('AFTER OPEN');
    --The table generation script
         loc_query := 'Select CONSTRAINT_NAME from user_constraints ';
         loc_query := loc_query || ' where owner = ' || '''CPS''';
         loc_query := loc_query || ' AND CONSTRAINT_TYPE = ' || '''P''';
         dbms_output.put_line('TABLE_NAME_ACCEPT = ' || TABLE_NAME_ACCEPT);
         IF NOT (TABLE_NAME_ACCEPT IS NULL ) THEN
              loc_query := loc_query || ' AND TABLE_NAME like ''';
              loc_query := loc_query || TABLE_NAME_ACCEPT ;
              loc_query := loc_query || '''';
         END IF;
         cursor_name := DBMS_SQL.OPEN_CURSOR;
    dbms_output.put_line('Query = ' || loc_query);
         DBMS_SQL.PARSE(cursor_name, loc_query, DBMS_SQL.v7);
    dbms_output.put_line('After parse');
         dbms_sql.DEFINE_COLUMN(cursor_name, 1,l_const_name, 30);
         ret := DBMS_SQL.EXECUTE(cursor_name);
    --     IF ret > 0 THEN
         LOOP
         dbms_output.put_line('return = ' || ret);
              IF DBMS_SQL.FETCH_ROWS(cursor_name) > 0 THEN
                   dbms_sql.COLUMN_VALUE(cursor_name, 1,l_const_name);
              --     dbms_sql.BIND_VARIABLE(cursor_name,
    l_const_name,CONSTRAINT_NAME);
              --     FOR C10 in Table_Loop Loop          --The cursor
    for the table name
                   Select COunt(*) INTO NumberoFColumns from
                   all_cons_columns
                   Where CONSTRAINT_NAME = l_const_name;
         --          FOR C11 IN c_columns(l_const_name) LOOP
         --          End loop;
         --          UTL_FILE.PUT(id, ');');
              ELSE EXIT;
              END if;     --THe 1 st cursor if is closed
         End Loop;     --The table loop ends here
              DBMS_SQL.CLOSE_CURSOR(cursor_name);
    --     END IF;     
    --     UTL_FILE.PUT_LINE(id,name);
    --     UTL_FILE.PUT(id,'It worked and wrote to this file');
         UTL_FILE.FCLOSE(id);
         DBMS_OUTPUT.PUT_LINE('Successful write to file');          
    EXCEPTION     
    WHEN OTHERS THEN               
         err := SQLERRM;          
         num := SQLCODE;
         DBMS_OUTPUT.PUT_LINE(err);          
         DBMS_OUTPUT.PUT_LINE(num);
         DBMS_OUTPUT.PUT_LINE('Error in writing to file');     
    END write_index;

  • Build daily Big flat file using SAP R/3 material master data

    Hi all,
    I must build an interface between SAP R/3 4.7 and an external application
    Daily a flat file must be generated contaning Material data in full exchange mode
    (volume 100 000 materials, <10 fields => ~ File of 30Mo)
    No complex mapping, only format mapping (Ex : Price quantity...)
    I don't know yet if I will use Idocs or BAPI to extract data. However, I'm sure I must use multiple inbound messages because of volume
    After reading documentation, I consider the both following solutions to manage it :
    1) A simple asynchronous interface with a file adapter in construction mode APPEND to build flat file progressively with arrival of SAP messages
    =>
    viable solution ?
    Is there problem of concurrent access to file in such a solution  ?
    (idocs or bapi data will be processed ones following the others )
    2) BPM Collecting and Bundling Messages - One Interface
    (Unlimited Loop with Deadline trigger correspondint to time I must build flat file)
    =>
    Each SAP message is a small message but the outbound XML will represent a 30 Mo flat file => Is it a problem ??
    Which solution do you advise ?
    Is there another ?
    Last question : (more general one)
    In such scenario, I can't see XI-value added comparing a creation of flat file directly with R/3.
    I will generate a big number of idocs, use a big part of XI memory ...
    Can you give me your opinion about it ?
    Thanks a lot
    Best regards
    Jean-Charles
    Message was edited by:
            Jean-Charles
    Message was edited by:
            Jean-Charles

    Hi Jean-Charles,
    >>>volume 100 000 materials, <10 fields => ~ File of 30Mo
    You have a performance task...
    >>>Is there problem of concurrent access to file in such a solution ?
    No, the adapter framework has its own queueing, the message would be stored and executed later. If sequence is important, you can use EOIO as well.
    >>>BPM Collecting and Bundling Messages - One Interface
    BPM is not required in your case, you should avoid becoz of performance task. You can append at file adapter, no problem. Bundling and splitting is even possible at Integration Server without BPM.
    >>>Each SAP message is a small message but the outbound XML will represent a 30 Mo flat file => Is it a problem ??
    Avoid using BAD words
    >>>Each SAP message is a small message but the outbound XML will represent a 30 Mo flat file => Is it a problem ??
    Use the <a href="https://websmp110.sap-ag.de/quicksizing">Quick Sizer</a> for sizing the hardware.
    Regards,
    Udo

  • Urgent: Problem to load Flat file using DTP.

    Hi Experts,
    I try to load a flat file  PSA->DSO->INFOCUBE using DTP.
    I my flatfile in the application server in csv format.
    in the My data source I opted Adapter  as Load Text -Type file from Application Server.
    Data Format : I test with both the potions : Fixed length &  Separated with Separator( For example CSV) .
    If I check the preview:  I cant find any data and get the message: Inbound processing of data package 000001 finished
    when  I try to Load the data thorough PC the load was successfull but only 0 records are transfered and added to PSA:; DSO and Info Cube.
    The test file contains around 20 records.
    Any suggestions please.
    Thanks & Regards

    Hi Sailekha..
    in the My data source I opted Adapter as Load Text -Type file from Application Server.
    Data Format : I test with both the potions : Fixed length & Separated with Separator( For example CSV) .
    Note: As per ur info:
    In the Flat file Data source :
    1. You have to maintain the Adapter as:
    Load Text -Type file from Application Server
    Data Format : Separated with Separator
    Then Use the "Proposal" Tab to generate the field proposals.
    (Only in BI 7.0 this option is available).
    After that check the Preview in "Preview" Tab.
    Hope it works...
    Cheers,...
    Varma

  • How to send the dynamically generated XML file to other site for further processing?

    I have a question regarding exchanging data between two systems
    using XSQL servlet. The situation is descrbed as the follows:
    Assume that we have a simple XSQL page named "emp.xsql"
    <?xml version="1.0"?>
    <?-- XSQL page file "emp.xsql" -->
    <xsql:query xmlns:xsql="urn:oracle-xsql" connection="demo" >
    SELECT * FROM EMP
    </xsql:query>
    and we can access it through the HTTP request likes
    http://web_server_name/xsql/emp.xsql.
    Usually we will the returned dynamic XML file and show it on the
    screen. Now the problem is that we don't want to show the
    generated XML file on the calling screen. Instead, we want to
    send the generated XML file to other website for further
    processing, say, using JSP or ASP likes
    http://other_web_server_name/XMLProcessing.jsp?.....
    How can it be implemented using XSQL servlet?
    Any hint and outline of the solution is appreciated.
    Thanks

    Ike,
    Do you have a sample. I am searched so much in this forum for samples. I looked on SAX Parser. I did not find any samples.
    Please help me.
    Thank you for your posting.
    Padma.

Maybe you are looking for

  • Music won't download from iCloud to iTunes or iPhone

    So, I recently downloaded the new iTunes. And then I realized I have two copies of the same song (one I bought and one was ripped from a CD). I decided to delete one copy. However this deleted all the music from that artist (over  one hundred songs,

  • Why does InDesign (CS6) run so very, very slowly on my Mac?

    Any idea what may be causing InDesign to run like it is stuck in molasses?  Everything takes minutes:  saving, opening a new document, opening an existing file, importing images, entering text - all slow. Any thoughts?

  • Transaction Launcher - Unable to access R3 transaction.

    Hi Experts, I am facing problem when accessing R3 document. When I try to open delivery document from Order(Steps: Open an Order, Go to Shipping Transaction, Select delivery document.), I get 5 errors Error 1: Details Mapped logical system ERP not de

  • Show currency in title of FSG

    According to the doc of metalink, I set control value in column sets to use the entered currency with FSG. How can I show the currency in title of report? I try &Currency. But it doesn't work.

  • Plot two graphs in same XY graph

    Hi i want to save the graphs which are generated by a Vi into  a file programically   how this can be done thanks in advance augustin Certified LabVIEW Associate Developer Solved! Go to Solution.