Dump data from a table into wwv_flow_files

HI,
Could you help me, to take data from a table, and insert it into blob_content in wwv_flow_files; and data should be stored in a .txt file
regards,
Rajesh

Alex Nuijten wrote:
But in case of APEX, that might be a really bad idea to insert metadata in the apex repository:
http://joelkallman.blogspot.com/2010/01/perils-of-modifying-application-express.html
This is not really an APEX metadata table, Alex. As far as I recall, it is a standard mod_plsql documents table that handles file uploads. One can also insert a document into the table dkirectly using an INSERT as it pretty straight forward.
Not exactly sure why though as the doc download procedure needs a LOB or CLOB.. and it does not care from what table you create it from - or whether you do it on the fly.
But still, you make an important point of using application/system objects for the purpose they have been designed for. And in this case, creating your own documents table may be a lot better.

Similar Messages

  • How to bind the data from user table into user report

    Hi All,
      Please assist me to bind the data from user table into user report. I did create an user table with data and create a user report template (using Query Print Layout). How can I display my data into report format which I created before? Any sample program or document I can refer?
    Platform: SAPB1 2005A
    Add On Language: VB.Net 2003
    Thanks.
    rgds
    ERIC

    Hi Ibai,
      Thanks for your feed back. I give you an example.
    Let say now i wanna print employee list, so i will go
    1. Main Menu -> Reports -> HR -> Employee List
    2. Choose the Selection Criteria -> OK
    3. Matrix will display (Employee List)
    4. I can print the report click on print button
    5. Printing report
    My target
    1. Main Menu -> Eric_SubMenu -> Employee List
    2. Matrix will display (Employee List)
    3. Print button
    4. Print report
    My problem
    Now I would like to use my own report format. My own report format means I wanna add on my logo or do some customization within the employee report. So how I am going to do? I only able to display the employee list in matrix. How do I create a new report format and display it.
    Thanks.
    rgds
    ERIC

  • Store data from a table into excel sheet and email

    Hi all,
    I am just wondering, i m not sure where to start. I want to insert data from a table into an excel spread sheet.
    I'm working on a stored procedure with 3 input parameters:
    1. the actual query
    2. userid
    3. the column headers (comma separated) - these will be in the same order as the outer select statement in the query itself. I will use the column headers for the respective columns in Excel worksheet.
    When the proc is executed, the excel is populated. If the record count is > 65536, then I need to create multiple worksheets in the same excel file.
    How can i do that? Can any body please help with this..?

    We are doing like this ( Not sure whether it is the best method available)
    --Get the output of the query (Since the number of columns is not fixed you would have to use dbms_sql package)
    --loop through the output and write into a file, for example test.csv, using UTL_FILE package
    --load the file into a blob variable(we are doing it by loading it into a table)
    --For mailing You can use the below package
    http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
    Mailing code we are using is given below:
    CREATE OR REPLACE procedure xls_mail(
        p_sender     varchar2, -- sender, example: 'Me <[email protected]>'
        p_recipients varchar2, -- recipients, example: 'Someone <[email protected]>'
        p_subject    varchar2, -- subject
         p_text           varchar2, -- text
         p_filename      varchar2, -- name of xls file
         p_blob           blob         -- xls file
    ) is
      conn      utl_smtp.connection;
      i number;
      len number;
    BEGIN
      conn := demo_mail.begin_mail(
        sender     => p_sender,
        recipients => p_recipients,
        subject    => p_subject,
        mime_type  => demo_mail.MULTIPART_MIME_TYPE);
      demo_mail.begin_attachment(
        conn         => conn,
        mime_type    => 'application/xls',
        inline       => TRUE,
        filename     => p_filename,
        transfer_enc => 'base64');
        -- split the Base64 encoded attachment into multiple lines
       i   := 1;
       len := DBMS_LOB.getLength(p_blob);
       WHILE (i < len) LOOP
          IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
             UTL_SMTP.Write_Raw_Data (conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_blob, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
          ELSE
             UTL_SMTP.Write_Raw_Data (conn
                                    , UTL_ENCODE.Base64_Encode(
                                            DBMS_LOB.Substr(p_blob, (len - i)+1,  i)));
          END IF;
          UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
          i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
       END LOOP;
      demo_mail.end_attachment(conn => conn);
      demo_mail.attach_text(
        conn      => conn,
        data      => p_text,
        mime_type => 'text/html');
      demo_mail.end_mail( conn => conn );
    END;

  • Retrive data from two tables into one internal table.

    Hi SDN,
    I am downloading the Assets data from two tables ANLA,ANLZ.
    there is a common field ANL1in both tables and i have to retrive the data by using anl1 into the internal table.
    can you please send me the SELECT Syntax for this probl.....
    Thank you & Regards,
    Manoj

    Hi manoj,
    Please see the following sample code. But kindly don't use join as it may hamper ur performance. No trouble in using two select query.
    data: begin of itab occurs 0,
            BUKRS like anla-BUKRS,
            ANLN1 like anla-ANLN1,
           BDATU like anlz-BDATU,
            end of itab.
    select anlabukrs anlaANLN1 anlzBDATU  into corresponding fields of table itab from anla inner join anlz on anlaanl1 eq anlz~anl1 where (logexp).
    Please come back for any clarification.
    Thanks and Regards,
    saurabh

  • Inserting data from one table into another table using PL/SQL

    HI,
    I am trying to insert values from one table into another using PL procedure, the values I want to retrieve from the table riverside1 are charac_id and charac_type and insert these values into another table called riverside2 , the stored procedure zorgs_gorfs(x,y) accepts two parameters which are 2 charac_id's of d characters in riverside1 then using insert statements inserts these characters from riverside1 into riverside2.
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (x);
    INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (y);
          END zorgs_gorfs;
    /This works but the problem im having is that when I also try to insert the charac_type as well as the charac_id it doesnt work below is the code:
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);
          END zorgs_gorfs;
    /can someone kindly sort me out

    modify this sql
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);as
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id in ( x,y));But my suggestion would be consider revising your approach. It does not look that good.
    Thanks,
    karthick.

  • Insert data from a table into 5 different tables

    My application has a data block than display information from another table. From this data block, the user has the option to select the records for upload. The information in the data block is used to insert data into 5 different tables. So if any exception occurs while inserting, the whole process should be rollback, but before this happen a record is inserting in a failed table indicated the reason of the failed.
    For this process I use the following commands:
    1.     sp_name := Get_Application_Property(SAVEPOINT_NAME);
    2.     INSERT DDL
    3.     INSERT DDL
    4.     INSERT DDL
    5.     INSERT DDL
    6.     INSERT DDL
    7.     If Other Exception then ISSUE_ROLLBACK(sp_name) Otherwise FORMS_DDL ('commit')
    The problem the previous insert(s) rollback
    Thanks,

    Hi,
    If you are using FORMS_DDL built-in to insert the data, then after each FORMS_DDL statement, you have to check the values of FORM_SUCCESS or FORM_FAILURE built-ins.
    FORMS_DDL('<insert_statement_1>');
    IF FORM_FAILURE THEN
    <the statement fails. so have to be rollbacked>
    END IF;
    FORMS_DDL('<insert_statement_2>');
    IF FORM_FAILURE THEN
    <the statement fails. so have to be rollbacked>
    END IF;Hope this helps.
    Regards,
    Manu.
    If my response or the response of another was helpful or Correct, please mark it accordingly

  • Error while downloading data from internal table into XML file

    hi all,
    i developed a program to download data from into internal table to xml file like this.
    tables: mara.
    parameters: p_matnr like mara-matnr.
    data: begin of itab_mara occurs 0,
                matnr like mara-matnr,
                ernam like mara-ernam,
                aenam like mara-aenam,
                vpsta like mara-vpsta,
          end of itab_mara.
    data: lv_field_seperator type c,     " value 'X',
          lv_xml_doc_name(30) type c,    " string value ‘my xml file’,
          lv_result type i.
          lv_field_seperator = 'x'.
          lv_xml_doc_name = 'my xml file'.
    types: begin of truxs_xml_line,
              data(256) type x,
          end of truxs_xml_line.
    types:truxs_xml_table type table of truxs_xml_line.
    data:lv_tab_converted_data type truxs_xml_line,
         lt_tab_converted_data type truxs_xml_table.
    data: lv_xml_file type rlgrap-filename value 'c:\simp.xml'.
    select matnr ernam aenam vpsta from mara into table itab_mara up to 5
           rows where matnr = p_matnr.
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = lv_field_seperator
      I_LINE_HEADER              =
      I_FILENAME                 =
      I_APPL_KEEP                = ' '
       I_XML_DOC_NAME             = lv_xml_doc_name
    IMPORTING
       PE_BIN_FILESIZE            = lv_result
      TABLES
        I_TAB_SAP_DATA             = itab_mara
    CHANGING
       I_TAB_CONVERTED_DATA       = lt_tab_converted_data
    EXCEPTIONS
      CONVERSION_FAILED          = 1
      OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    open dataset lv_xml_file for output in binary mode.
    loop at lt_tab_converted_data into lv_tab_converted_data.
    transfer lv_tab_converted_data to lv_xml_file.
    endloop.
    close dataset lv_xml_file.
    this program is syntactically correct and getting executed, but when i open the target xml file it is showing the following error.
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    XML document must have a top level element. Error processing resource 'file:///C:/simp.xml'.
    will anyone show me the possible solution to rectify this error
    thanks and regards,
    anil.

    Hi,
    Here is a small sample program to convert data in an internal table into XML format and display it.
    DATA: itab  TYPE TABLE OF spfli,
          l_xml TYPE REF TO cl_xml_document.
    * Read data into a ITAB
    SELECT * FROM spfli INTO TABLE itab.
    * Create the XML Object
    CREATE OBJECT l_xml.
    * Convert data in ITAB to XML
    CALL METHOD l_xml->create_with_data( name = 'Test1'
                                         dataobject = t_goal[] ).
    * Display XML Document
    CALL METHOD l_xml->display.
    Here are some other sample SAP programs to handle XML in ABAP:
    BCCIIXMLT1, BCCIIXMLT2, and BCCIIXMLT3.
    Hope this helps,
    Sumant.

  • Import data from Oracle table into flat file

    How to import the data in the oracle table into flat file using UTL File of PL/SQL....
    I am new in PL/SQL..
    can someone help me in writing query?

    Note : Not Tested.
    DECLARE
    V1 VARCHAR2(32767);
    F1 UTL_FILE.FILE_TYPE;
    cursor c1 is select ename,empno from emp;
    r_c1 c1%rowtype;
    BEGIN
    -- In this example MAX_LINESIZE is less than GET_LINE's length request
    -- so the number of bytes returned will be 256 or less if a line terminator is seen.
    open c1;
    F1 := UTL_FILE.FOPEN('MYDIR','MYFILE','W',256);
    loop
    fetch c1 into r_c1;
    v1:= r_c1.ename||''||To_char(r_c1.empno);
    UTL_FILE.PUT_LINE (F1, v1,TRUE);
    v1:= null;
    Exit when c1%not found;
    end loop;
    UTL_FILE.FCLOSE(F1);
    END;
    http://download.oracle.com/docs/cd/B19306_01/appdev.102
    ------------------------------------------------------------------

  • Writing data from a table into a spreadsheet file

    I've managed to figure out putting a table on the screen for user in put (I think  I made it more difficult for myself than it actually was) and I can have LabVIEW convert the data into a spreadsheet string and display that for me.  Now I'd like to send the data entered into the table out as a tab-delimited text file.  What's holding me up at the moment is that not all the data in the table is numeric.  I've got four columns, the first of which will hold an 8- or 9-digit serial number, presently starting with 0.  Columns 2-4 will be numeric (integer) information.  What's the proper way to get my table data into this tab-delimited text file?
    Thank you for your help.
    -Dan

    Hi,
    The attached example shows how table content is convert to spreadsheet string for storing, as well as converting read spreadsheet string to table data for displaying.
    Hope this is useful
    Regards,
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    IFK_TABLE_Saving & Retrieving Table Content.vi ‏69 KB

  • Loading Data from multiple tables into essbase using ODI

    Hi,
    We have a scenario where data comes from multiple tables. I would like to know how will ODI load this data for the right combination of the members

    Hi,
    I take it each data table has a field which maps to the other table. You can just drag the datastores on to the source interface and create a join between the tables.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Error loading data from bw table into BW system

    Dear all,
    I have created and fill z tables in bw system, and try to load data into same bw system.
    What i am facing is error message saying "Error in module RSQL of the database".
    and when i check st22 for dump analysis, it says:
    Runtime Errors         DBIF_RSQL_INVALID_RSQL
    Exception              CX_SY_OPEN_SQL_DB
    how come?
    Thanks

    Can you try again by activating the generic datasource in RSO2. It should work.
    And also make sure the tables are active.
    Ravi

  • Access 2010 - How to display data from a table into a text box upon combo box selection?

    Hi
    I have a a table with 5 columns: month, year, USD, SGD, BAHT.
    I created a form with a combo box for selection of the month and year, and I would like to set adjacent text boxes to show USD, SGD, BAHT information. How can i go about doing that?
    From the Q&A here, most of them uses the function similar to this "=[Combo0].[Column](1)" to show the data in the text box, but this would require the combo box to list a whole bunch of details if i were to add in more currency values to the
    table. Is it possible to not show this information in the combo box, but still populate data in the textboxes base on a selection on only the "month" and "year" in the combo box.

    Hi,
    According to your description, my understanding is that you want to show only the month/year in the combo box, we can choose the date, and it will display the value of USD/SGD/BAHT based on the month/year.
    If it is, I recommend you try the steps:
    Create a form based on your data source table>Add the combo box>combo box wizard>Find a record on my form based on the value I selected my combo box>Add mouth and year to selected fields
    http://office.microsoft.com/en-us/access-help/create-a-list-of-choices-by-using-a-list-box-or-combo-box-HA010113052.aspx
    If I misunderstand something, please let me know. We may upload some screenshots or a sample through OneDrive.
    Regards,
    George Zhao
    TechNet Community Support

  • How to insert data from a table into itself if they don't already exist meeting a certain condition

    First, let me apologize as I did not write/design this mess, just inherited this terrible design and legacy application!
    I have table of companies and a table of suppliers with various attributes and of them being a bit column of is_public.  The public suppliers then need to be inserted into the table as suppliers for the other suppliers.
    As an example, in the company table company 'PUB01' is flagged as a public supplier (Company.IS_PUBLIC_SUPPLIER = 1).  Therefore in the Suppliers table I need to insert a row for each each of PUB01's suppliers in that same table to all the other suppliers
    in that table if they do not already exist as follows:
    Here is a sample of the table structure:
    CREATE TABLE [dbo].[COMPANY](
    [COMPANY_ID] [nvarchar](15) NOT NULL,
    [COMPANY_NAME] [nvarchar](100) NOT NULL,
    [IS_PUBLIC_SUPPLIER] bit NOT NULL,
     CONSTRAINT [PK_COMPANIES] PRIMARY KEY CLUSTERED 
    [COMPANY_ID] ASC
    ) ON [PRIMARY]
    GO
    CREATE TABLE [dbo].[SUPPLIERS](
    [SUPPLIER_ID] [int] IDENTITY(1,1) NOT NULL,
    [COMPANY_ID] [nvarchar](15) NOT NULL,
    [SUPPLIER_NAME] [nvarchar](100) NOT NULL,
    [PUBLIC_SUPPLIER_ID] [int] NULL,
     CONSTRAINT [PK_SUPPLIER_MASTER] PRIMARY KEY CLUSTERED 
    [SUPPLIER_ID] ASC
    GO
    Thanks!

    Thanks Visakh!  Will that work if some have already been inserted previously?
    Yes
    but if you want to exclude them use this
    INSERT INTO Suppliers(Company_ID,Supplier_Name,PUblic_Supplier_ID)
    SELECT s1.Company_ID,
    s2.Supplier_Name,
    s2.Supplier_ID
    FROM Suppliers s1
    CROSS JOIN Suppliers s2
    WHERE EXISTS(
    SELECT 1
    FROM Company
    WHERE Company_ID = s2.Company_ID
    AND IS_PUBLIC_SUPPLIER = 1
    AND s1.COMPANY_ID <> s2.COMPANY_ID
    AND NOT EXISTS (SELECT 1
    FROM Suppliers
    WHERE Company_ID = s1.Company_ID
    AND Supplier_Name = s2.Supplier_Name
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Dump data from server (unix) into flat file on client (PC) on regular schedule

    Hi folks,
    I wish to dump the contents of a table (Oracle on Unix) into a file residing in a local directory (PC client). I know how to use utl_file but, init.ora resides on unix, therefore it will create file on unix directory and not the client machine.
    Any ideas?

    Hi Bro
    if u wan to write a file on Server use this code..
    procedure write_file
    filename varchar2,
    mesg varchar2
    is
    hfile_handle utl_file.file_type;
    begin
    begin
    file_handle := utl_file.fopen( '<FILE_PATH_HERE>', filename, 'A');
    exception
    when utl_file.invalid_path then
    dbms_output.put_line('invalid path dummy');
    when utl_file.invalid_operation then
    file_handle := utl_file.fopen( '<FILE_PATH_HERE>', filename, 'W');
    when others then
    raise;
    end;
    utl_file.put( hfile_handle , mesg);
    utl_file.fclose( hfile_handle );
    exception
    when utl_file.invalid_path then
    dbms_output.put_line('invalid path dummy');
    when utl_file.invalid_operation then
    dbms_output.put_line('invalid opertaion dummy');
    when others then
    raise;
    end write_file;
    ==================================================
    and If you want it in the client you can use the one given below.
    declare
    file_handle text_io.file_type;
    L_file_name := 'C:\Folder1\Filename.txt';
    begin
    file_handle := text_io.fopen(L_file_name,'w'); (mode should be 'a' instead of 'w' if u want to append)
    text_io.put_line(file_handle,l_data) ;
    text_io.fclose(file_handle) ;
    end;
    4 any help plz write me
    Khurram.

  • Combining data from multiple tables into report

    I'll try my best to describe my issue accurately.
    I bring in two tables and link them together in my report. First table is a Location table.   I create a running total field to summarize the location details in order to to produce total square footage for each location.  Let's say the total square footage for Building A is 100,000 ft.².
    The second table is an Employee table. This table lists the details of each employee. Each employee record contains a location ID that allows me to link this table to the Location table.  Within the report I create a running total field to summarize the total number of employees for each location.  Let's say the total number of employees for building a is 12.
    Now, I have a group footer which contains the name of each location. Next to the location name I insert my first running total field which summarizes the location details and provides the total square footage.  In my example Building A = 100,000 square-foot.
    now I'm ready to insert my second running total field which summarizes the number of employees within each location. In my example, Building A =12 employees.  The moment I insert my second running total field, the square footage from the first running total field changes to 1,200,000 ft.². I can see the correlation between the number of employee records which is 12 and the change in square footage.
    Where am I going wrong??  Please help....
    THANKS

    Please post DDL+DML!
    DDL = Data Definition Language. In our case that is, CREATE TABLE statements for your tables and other definitions that are needed to understand your tables structure and there for let us to test and reproduce the problem in our server. Without DDL no one
    can execute any query.
    How to get DDL: Right click on the table in Object Explorer and select script table as CREATE. Post these create table scripts here.
    DML = data manipulation language is a family of queries used for manipulating the data it self like: inserting, deleting and updating data. In our case we need some sample data in order to check the query and get result, so we need some indert query for
    sample data.
    If you post a "create query" for the tables and "insert query" with some sample, then we could help you without Assuming/Guessing. There is a reason that DDL is generally asked for and expected when discussing query problems - it helps to identify issues,
    clarify terminology and prevent incorrect assumptions.  Sample data also provides a common point of reference for the discussion. A script that can be used to illustrate or reproduce the issue you have, will encourage others to help.
    [Personal Site] [Blog] [Facebook]

Maybe you are looking for