Downloading data from a BLOB Field using mod_plsql

Hi,
I am trying to use the mod_plsql to download data from a blob field, I have a web page where I can pick the file name to be downloaded from the documents table This table has the BLOB field that has the Data formatted in a text file format(contains carriage returns), when I open it up in the browser it is displaying it correctly , but when I right click on the file name and choose "Save Target As" and save it as text file it is ignoring the carriage returns and displaying entire blob in one line.
Can somebody help me figure out why it's not recognizing the carriage returns?
Any help would be greatly appreciated.
Thanks

Hi and welcome to the forum.
Is there a way to retrieve data from a blob field and save it to temp table.Why would you want to do that?
Can you provide some more details regarding your requirement?
(Don't forget to mention your database version as well)
Also, I wonder why you've added a 'decompress' tag to your question?
edit, after seeing Tubby's reply
Dang, the connection must be frozen here ;)
Edited by: hoek on Jan 6, 2010 9:06 PM

Similar Messages

  • Extract Data from a Blob field

    I have a BLOB type field in a Table. Now I would like to have a Pl/Sql code or C code which could read the data in the BLOB field which is in XML format. Actually the data in the BLOB a record and I would like to take only required data from the BLOB and insert into another Table

    You might want to look at these OTN articles:
    [list][*]Managing Web Content
    [*]Customizing Content with XML
    [list]
    These apps use CLOBs instead of BLOBs to store XML documents, but they might give you some ideas.
    Good luck,
    -rh

  • Download Data from OBIEE to Excel using Macro (ODBC connection)

    Hi,
    We have OBIEE used as data source for reporting. Currently we manually go into OBIEE and download the report in Excel Format. However we want that to be automated by writing a macro and connecting directly do the DB and querying the data.
    Do anyone have the details on how to connect to OBIEE using Excel Macros? I am not a Oracle developer and I am not allowed to install any software in my system. So if there is a way I can connect, please let me know. Thanks so much for you help.

    download oracle bi for microsoft office software available in obiee>>answers>>more products. login to obiee to get it and once you installed then you can directly connect to obiee from excel itself and download report.
    Thanks
    Jay.

  • Export XML data from a CLOB field using sql developer

    I have a table that contains a CLOB field, each record is a complete XML in itself. After running the select query i am exporting this data by right clicking on the answer set, while the export completes the data for each record gets truncated.
    When i chose to save the export in loader format i get the complete records but now there are n files created for n records exported.
    Is there a way i can get alll the records in a single file wirthout any truncation.
    Thanks in advance!

    You might try delimited format or csv, with no enclosures if desired.

  • Download Data From Excel - VBA Code to SAP Using BDC

    Hi ,
    I am Sudhir Dure, working with Satyam Computers.
    I need help on the below query:
    I have an excel file which download data from Excel to SAP using RFC function & with the help of VBA interface.
    In this VBA code I have used BDC recording of SAP Transaction KE21N to post data into SAP.
    Now I am facing problem to find sub screen (tab page screen ) in SAP from VBA code .
    How to pass BDC Subscreen details from VBA code to SAP using below code?
    BDCTABLE.Rows.Add
    BDCTABLE.Cell(J, "PROGRAM") = PROGRAMNAME
    BDCTABLE.Cell(J, "DYNPRO") = "0200"
    BDCTABLE.Cell(J, "DYNBEGIN") = "X"
    BDCTABLE.Cell(J, "FNAM") = "BDC_OKCODE"
    BDCTABLE.Cell(J, "FVAL") = "=NEXT"
    Thanks,
    Sudhir Dure
    9972097464

    can anyone tell me how to get the PurchaseOrder number and item quantity from the Salesorder...? what are the fields here as given below..??
    For Each oItem In oSalesOrder.items
    wsTemplate.Range(cols(3) & Indexv).Value = oItem.material.material
    'wsTemplate.Range(cols(4) & Indexv).Value = ' I need item quantity here ????
    wsTemplate.Range(cols(1) & Indexv).Value = sapSoNumber
    wsTemplate.Range(cols(2) & Indexv).Value = ' I need purchase order number here>???
    Indexv = (Indexv + 1)
    Next
    reply fast. please .. thanks

  • HT2486 Iam trying to download data from a group in my address book into Numbers.  When I click on the data to move and drag to Numbers nothing happens.  Using OS X ver 10.9.2 iMac

    Iam trying to download data from a group in my address book into Numbers.  When I click on the data to move and drag to Numbers nothing happens.  Using OS X ver 10.9.2 iMac

    With Numbers 3.2 (released April 2014) drag and drop works on my machine again, either onto the canvas or into an existing table.
    What also works (as Wayne described): select multiple contacts, command-c to copy, and (after clicking the canvas or a cell) command-v to paste.
    SG

  • Can we download employee data from ECC to CRM using standard middleware?

    HI,
    Can we download employee data from ECC to CRM using standard middleware? If yes pl give me the procedure.(not using HR ALE/IDOC)
    Thanks,
    Regards,
    PV

    Standard replication for employee to CRM is using ALE.
    BDoc send information for CRM for other business partner. If you want to use BDOC message for send employee to CRM, you should build your own BDOC message that read HCC Table and send this information to CRM.
    However send this information using ALE is not difficult. Why don't you wan to use ALE?
    Regards,
    Lyda

  • How to download data from an internal table to a text

    Hi All,
    I want to download data  from an internal table to a text file.
    The fields should be pipe(|) separated. I have tried GUI_DOWNLOAD but it is not taking the field separator.
    The sample of the desired data that i require should be this way:-
    13456TR|M|COUP|MATERIAL|KGS
    Thanks in advance.
    Regards
    Satish.

    Hi,
    Try this..
    REPORT  zc1download message-id zc1dwnmsg.
    *& Declaration Section for the Tables *
    TABLES: makt.
    *& Declaration Section for the Internal Tables
    DATA: intab TYPE TABLE OF makt,
          wa_intab LIKE LINE OF intab,
          no_of_rec TYPE i,
          count TYPE i.
    DATA: BEGIN OF f_intab,
            str(255) TYPE c,
          END OF f_intab.
    DATA: t_intab LIKE TABLE OF f_intab,
          w_intab LIKE LINE OF t_intab,
          temp(255) TYPE c.
    FIELD-SYMBOLS: <f> TYPE ANY.
    *& Selection ScreenSection for the file download
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: file TYPE rlgrap-filename MEMORY ID file,
                tab RADIOBUTTON GROUP rad1 DEFAULT 'X',
                others RADIOBUTTON GROUP rad1,
                delimit TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      IF file IS INITIAL. " check to ensure file.
        MESSAGE i001.
        EXIT.
      ENDIF.
      IF others = 'X'.    " check to ensure delimiter.
        IF delimit = ' '.
          MESSAGE i002.
          EXIT.
        ENDIF.
      ENDIF.
      SELECT * FROM makt INTO TABLE intab.
      IF tab = 'X'.       " default delimiter tab is used
          CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'DAT'
            mode                    = 'A'
          TABLES
            data_tab                = intab
          EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            no_authority            = 10
            OTHERS                  = 11.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ELSE.             " If user defind delimiter is to be used
                  Counts the number of fields                *
        DO.
          ASSIGN COMPONENT sy-index OF STRUCTURE wa_intab TO <f>.
          IF sy-subrc <> 0.
            EXIT.
          ELSE.
            count = count + 1.
          ENDIF.
        ENDDO.
        LOOP AT intab INTO wa_intab.
          DO count TIMES. " Adding the delimiter in required places
            ASSIGN COMPONENT sy-index OF STRUCTURE wa_intab TO <f>.
            CONCATENATE temp delimit <f> INTO temp.
          ENDDO.
          SHIFT temp.
          APPEND temp TO t_intab.
          CLEAR temp.
        ENDLOOP.
        CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'ASC'
            mode                    = 'A'
          TABLES
            data_tab                = t_intab
          EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            no_authority            = 10
            OTHERS                  = 11.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
      WRITE:/ 'The Data has been tranfered to :', file.
    Cheers
    Kathir!~

  • Downloading data from internal table to xls file leading zeros are not disp

    Hai abap gurus,
    when i am downloading data from internal table to excle file. some field values in a column are with leading zeros and some others dont have leading zeros.but in the output it is showing without leading zeros. then how to get with exact values.
    Ex:
    <b>ECC Code.</b>
    045234
      88567
    098456 
    but output is giving like this:
    45234
    88567
    98456
    how to get the actual values.....
    plz help me in this matter.

    Dear Kiran,
    Those field in the internal table having Leading Zeroes, make those fields' datatype as character.
    Then use the function module to download the content of the internal table to the excel file.
    Regards,
    Abir
    Don't forget to Reward Points  *

  • What are the ways to download data from ods?

    Hi all,
    what are the ways to download data from ods?
      1. se11/se12
      2. listcube
      3. infospokes.
    Apart from the above 3 is there any other way to download data from my ods.
    I need to download around 90 fields from my ods to a flat file. But listcube doesnt allow me to select all the fields. So i used se11 to download the data from my ods. bUt still se12 doesnt allow me to download all the 90 fields it downloads only 40 fields.
    Can anyone suggest me how to select all the 90 fields and download it to an excel sheet.
    thanxs
    haritha

    Hi Haritha,
    Go to Tcode SE16, give your ODS active Table name and give width of output list as 1023.
    Now run transaction to see your data and then click Settings --> User parameters and Select ALV Grid Display.
    Now you should see and Excel Icon on top, click on it then select Table , then
    Microsoft Excel and it will open your data with all columns you want.
    I just tried for 213 columns
    Hope this helps.
    Thanks
    CK

  • I cannot display image (read from oracle BLOB field) on browser?

    I cannot display image (read from oracle BLOB field) on browser?
    Following is my code, someone can give me an advise?
    content.htm:
    <html>
    <h1>this is a test .</h1>
    <hr>
    <img  src="showcontent.jsp">
    </html>showcontent.jsp:
    <%@ page import="com.stsc.util.*" %>
    <%@ include file="/html/base.jsp" %>
    <% 
         STDataSet data = new STDataSet();
    //get blob field from database     
         String sql = "SELECT NR FROM ZWTAB WHERE BZH='liqf004' AND ZJH='001'";
         //get the result from database
         ResultSet rs = data.getResult(sql,dbBase);
         if (rs!=null && rs.next()) {
              Blob myBlob = rs.getBlob("NR");
              response.setContentType("image/jpeg");//
              byte[] ba = myBlob.getBytes(1, (int)myBlob.length());
              response.getOutputStream().write(ba);
              response.getOutputStream().flush();
         // close your result set, statement
         data.close();     
    %>

    Don't use jsp for that, use servlet. because the jsp engine will send a blank lines to outPutStream corresponding to <%@ ...> tags and other contents included in your /html/base.jsp file before sending the image. The result will not be treated as a valid image by the browser.
    To test this, type directly showcontent.jsp on your browser, and view it source.
    regards

  • How to exctract data from a report to use it in a process

    Hi! I would like to know how to exctract data from a report to use it in a process. Let's say that I have a report which have following fields: id_person, name_person. And then, I want to make a process which introduce the id_person (from report) into an associative tabel. How can I reffer to the fields from my report?
    I was thinking about something like that( this should be the code from my process)
    insert into associative_table(id_person)
    values(id_person) or
    insert into associative_table(id_person)
    values(Report_name.id_person) but it doesn't work....
    Thank you very much.

    Another option, use collections.
    Create an on load process that loads all the rows you would have in your report into a collection:
    begin
    HTMLDB_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(
    p_collection_name => 'ASSIGNED_CALENDAR_CONTACTS' );
    for x in (SELECT CONTACT_ID, CONTACT_FNAME, CONTACT_LNAME
    FROM CONTACT
    WHERE InStr( pkg_CalendarMgr.f_FetchContactIDsForDay( TO_DATE( :P3_CALENDAR_DT, 'YYYYMMDD' ), 'OF' ), CONTACT_ID ) > 0 )
    loop
    htmldb_collection.add_member(p_collection_name => 'ASSIGNED_CALENDAR_CONTACTS',
    p_c001 => x.CONTACT_ID,
    p_c002 => x.CONTACT_FNAME,
    p_c003 => x.CONTACT_LNAME);
    end loop;
    end;
    Then, instead of your report selecting from the table, have it select from the collection, this way your display will match what's in the collection:
    SELECT c001, c002 || Chr(32) || c003 CONTACT_NAME, 'Remove' remove
    FROM htmldb_collections
    WHERE collection_name = 'ASSIGNED_CALENDAR_CONTACTS'
    ORDER BY c003, c002
    Then you can have a button on the form that steps through the collection, one element at a time and does whatever you want it to.

  • Apex.ajax.clob - retrieving data from a clob field

    I have an application that uses a table that stores xml data, and the field in the table that stores the data is a clob. I used Carl Backstrom's example to build what I have so far, (God's blessings on his family). Here is the script I use to store the data from an HTML Editor into the database:
    function clob_set(request){
    var oEditor = FCKeditorAPI.GetInstance('P59_CONTENT');
    var clob_ob = new apex.ajax.clob(
    function(){
    var rs = p.readyState
    if(rs == 1||rs == 2||rs == 3){
    $x_Show('AjaxLoading');
    }else if(rs == 4){
    $x_Hide('AjaxLoading');
    $s('P59_CONT', p.responseText);
    doSubmit(request)
    }else{return false;}
    $x('P59_CONT').value = oEditor.GetHTML();
    oEditor.SetHTML('');
    if(!$v_IsEmpty('P59_CONT')){clob_ob._set($v('P59_CONT'))};
    The submit calls a process that inserts the data from the clob001 field in the CLOB_CONTENT collection into my table.
    How do I get the data out of the table again to present in the HTML Editor? Each option I use gets me into trouble with the 32k length limitation that is extant in Apex. What would be the best way to address this?

    Inserting or retrieving a clob in the database is simple and can be done with a pl/sql process. It gets more more complex when the clob is large; I believe the limit is 32k? Larger than that and the HTTP process cannot manipulate the data stream.
    The key to manipulating clobs successfully is through the use of collections, and javascript. In my case, I used the standard html editor item (fckeditor) to retrieve the data and present it on the page through the apex.ajax.clob javascript function. The clob_set method in the apex.ajax.clob function that I mention in the previous sections of this post calls the 'doSubmit(request)' that causes a pl/sql function to be fired that writes the clob to the database from the collection created by the clob_get method. The collection that the clob_get method creates is called 'CLOB_CONTENT', and can be accessed through the 'apex_collections' view through standard sql within APEX. In my case, the pull the 'clob001' field from the 'CLOB_CONTENT' collection after the clob_set method runs, and I insert the value from 'clob001' into the table I have created for storing the clob content. The clob_set pulls the data from the HTML editor (FCKeditorAPI.GetInstance('P59_CONTENT')) through the GetHTML() method that is part of the FCKeditorAPI.
    function clob_set(request){
    var oEditor = FCKeditorAPI.GetInstance('P59_CONTENT');
    var clob_ob = new apex.ajax.clob(
    function(){
    var rs = p.readyState
    if(rs == 1||rs == 2||rs == 3){
    $x_Show('AjaxLoading');
    }else if(rs == 4){
    doSubmit(request);
    $x_Hide('AjaxLoading');
    }else{return false;}
    var p_html = oEditor.GetHTML();
    if (p_html){
    clob_ob._set(p_html);
    else {
    p_html = ' '
    clob_ob._set(p_html);
    The clob_get method pulls the data from the 'CLOB_CONTENT' collection and puts it into the html editor item I have created, performing the process in reverse. The primary difference with reversing the process is that a pl/sql function is created that populates the clob001 field in the 'CLOB_CONTENT' collection prior to the clob_get function firing:
    declare
    l_clob clob:= empty_clob();
    begin
    if apex_collection.collection_exists(p_collection_name=>'CLOB_CONTENT') then
    apex_collection.delete_collection(p_collection_name=>'CLOB_CONTENT');
    end if;
    apex_collection.create_or_truncate_collection(p_collection_name=>'CLOB_CONTENT');
    dbms_lob.createtemporary( l_clob, false, dbms_lob.SESSION );
    if trim(:P123_ID) <> 0 then
    select
    nvl (ltr,'There is no letter assigned.')
    into
    l_clob
    from grant_tbl
    where id = to_number(:P123_ID);
    apex_collection.add_member(p_collection_name => 'CLOB_CONTENT'
    ,p_clob001 => l_clob
    ELSE
    apex_collection.add_member(p_collection_name => 'CLOB_CONTENT'
    ,p_clob001 => 'You must select an item to view its letter.');
    end if;
    end;
    The clob_get function is below. Notice that the line "$s('P123_CONTENT',p.responseText);" is taking the output from the clob_get and setting the value of the P123_CONTENT page item (which is my standard html editor item) with the 'responseText'. the 'p' object and the 'responseText' method are built into the clob_get function when a 'new apex.ajax.clob' object is created. Confusing? Tell me about it!
    function clob_get(){
    var clob_ob = new apex.ajax.clob(
    function(){
    var rs = p.readyState
    if(rs == 1||rs == 2||rs == 3){
    null;
    }else if(rs == 4){
    $s('P123_CONTENT',p.responseText);
    null;
    }else{return false;}
    clob_ob._get();
    }

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

  • Error while loading data from PSA to DSO using DTP

    Hi,
    I have a Unique aplha numeric identifier of  type "Char" length "32" . When I am loading the data from PSA to DSO using DTP I get the following error message:
    "An error occurred while executing a transformation rule:
    The exact error message is
    Overflow converting from ' '
    The error was triggered at the following point in the program:
    GP4JJHUI6HD7NYAK6MVCDY4A01V 425
    System response
    Processing the data record has been terminated"
    Any idea how I can resolve this....
    Thanks

    Hi,
    fist check weather any special characteristics if not
    check in data source under this we have fields tab check the format of a particular field format internal/external/check u choose internal format, if any check routine once
    use Semantic Groups in the DTP.
    Try  it
    Thanku
    lokeeshM
    Edited by: lmedaSAP_BI on Oct 20, 2010 6:44 AM

Maybe you are looking for

  • How do I print a mirror image?  Where did the old functionality go?

    Within the last several months I was able to print a mirror image of my document to my HP DeskJet F4180 in high resolution. I don't know if it is the new HP drivers, or my new Snow Leopard OS but now I can' figure out how to do it again. I can grab a

  • Disk Utility - Restoring a previous image

    Since I first bought my Mac Mini (February of this year) I've been using the disk utility to make occasional backups (disk images) of my partitions, in case I ever need to restore a whole partition (or create a clone of an existing partition - for ex

  • Report to find Exit Interview List?

    Dear Experts,             Is there any standard Report to find out total number of Exit Interviews done so far with Divisions wise Please advice Thanks & Regards Khaiser

  • Itunes dosen t recognize my ipad

    when i connect my ipad 2 to itunes a popup says This cannot be used because the apple mobile device is not started                                   what i can do

  • R3AD_CUSTOME and R3AD_SAL_ERR* are sysfail

    Hi Expert, SMQ2 --> R3AD_CUSTOME and R3AD_SAL_ERR* are sysfail in CRM2007 system. Status Text is displayed "Update BDoc status failed - BDoc not found" I deleted all queue in SMQ2 but recreate continuously. there are entries 987 now and then increase