Manual Exporting of BLOB specific table to text file

Hi,
Our application is having 60000 record in a BLOB specific table.
My requirement is to export the entire table data to text files .
When I tried converting BLOB to sting and writing to file, it took almost 3 mins for 100 records, if so, will take so much of time in exporting data from BLOB specific table.
I am using the following logic,
byte[] bdata = blob.getBytes(1, (int)blob.length());
String data1 = new String(bdata);
buffer.append(data1);
Can anyone please tell me how can I speed up the operation.

>
Our application is having 60000 record in a BLOB specific table.
My requirement is to export the entire table data to text files .
>
Welcome to the forum!
If you are looking for a pure Java solution you should post this question in the JDBC forum.
https://forums.oracle.com/forums/category.jspa?categoryID=288
Unless your BLOB data is located inline you are going to use Oracle to read 60,000 files, one at a time, and then use Java to write 60,000 files one at a time.
That will be a very slow process.
Also - your Java code is only going to read the LOB locator and inline BLOB data since you are not getting and processing the actual stream.
See 'Reading and Writing BLOB, CLOB and NCLOB Data' in the JDBC Dev Guide for details
http://docs.oracle.com/cd/B28359_01/java.111/b31224/oralob.htm#sthref756

Similar Messages

  • Export data from a table to text file using srcipt task

    Hi
    i am new to SSIS
    i have to export data from a table and append it into a existing file through SSIS script task
    please help
    Thanks
    Umesh

    Hi Umesh,
    The data structure of the source table and the structure of the destination file are the same, right? Is the destination file a flat file? Do you have to do it through Script Task? If the destination file is a flat file, this can be done easily by using
    the stock tasks/components other than .NET code. In the Data Flow Task, we choose the appropriate source adapter (such as OLE DB Source or ADO.NET Source) to extract data from the source table, perform transformation if necessary, and then load to the destination
    file via a Flat File Destination. When setting up the Flat File Destination, uncheck the “Overwrite data in the file” option so that the extracted data will be appended to the existing file.
    If you need to implement it through Script Task/Component indeed, you may benefit from the following code examples:
    http://stackoverflow.com/questions/8070163/how-to-add-custom-footer-to-an-ssis-flat-file-seperate-component-or-script-tas 
    http://stackoverflow.com/questions/8467326/add-header-and-footer-row-flat-file-ssis 
    If you need further help about the script, I suggest that you ask a new question in .NET forums where you can get more dedicated support:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=netdevelopment 
    Regards,
    Mike Yin
    TechNet Community Support

  • Exporting list of tables to text files?

    Anyone have solution for exporting list of SQL tables to text files?
    My goal is to have a flexible/dynamic way to export sql tables to text files that is executed via a sql job. I plan on having a configuration table that has sqltablename, fieldstoexclude (maybe fieldstoinclude - not decided), path, filename, includeheader,
    delimiter. So the SSIS package will query the configuration table and that will be the loop. One text file for each configuraton.tablename row.
    Does anyone have an already built solution that they can share? I have seen some with vb script and am not opposed, but would like to have a strictly SSIS package that uses SQL queries for the solution.

    Try using this as your query (Remember to set the database you want to use first:
    DECLARE @tableBuilder TABLE (dSQL VARCHAR(MAX))
    DECLARE @tableString VARCHAR(100), @newTableString VARCHAR(100), @columnString VARCHAR(MAX), @dSQL VARCHAR(MAX) = ''
    DECLARE tableBuilder CURSOR FOR
    SELECT
    'CREATE TABLE '+d.name+'.'+t.name ,
    c.name + ' ' +
    CASE
    WHEN st.NAME IN ('float','image','text','uniqueidentifier','date','time','datetime2','datetimeoffset','tinyint','smallint','int','smalldatetime','real','money','datetime','smallmoney','bigint','bit','hierarchyid','timestamp','xml','geometry','geography','sql_variant','sysname') THEN st.name
    WHEN st.name IN ('decimal','numeric') THEN st.name + '(' + CONVERT(VARCHAR,c.precision) + ',' + CONVERT(VARCHAR,c.scale) + ')'
    WHEN st.name IN ('nvarchar','nchar','char','varbinary','varchar','binary','ntext') THEN st.name + '(' + CONVERT(VARCHAR,c.max_length) +')'
    END + ','+ char(13)+CHAR(10)
    FROM sys.tables t
    LEFT OUTER JOIN sys.extended_properties ep
    ON t.object_id = ep.major_ID
    AND ep.name = 'microsoft_database_tools_support'
    INNER JOIN sys.columns c
    ON t.object_id = c.object_id
    INNER JOIN sys.systypes st
    ON c.system_type_id = st.xtype
    INNER JOIN sys.databases d
    ON DB_ID() = d.database_id
    WHERE ep.name IS NULL AND is_ms_shipped = 0
    ORDER BY t.name, c.column_id
    OPEN tableBuilder
    FETCH tableBuilder INTO @tableString, @columnString
    WHILE @@FETCH_STATUS <> -1
    BEGIN
    IF @tableString <> @newTableString
    BEGIN
    SET @dSQL = @newTableString + char(13)+CHAR(10) + ' (' + char(13)+CHAR(10) +LEFT(@dSQL,LEN(@dSQL)-3) + char(13)+CHAR(10) + ' )'
    INSERT INTO @tableBuilder ( dSQL ) VALUES (@dSQL)
    SET @dSQL = ''
    END
    SET @dSQL = @dSQL + ' ' + @columnString
    SET @newTableString = @tableString
    FETCH tableBuilder INTO @tableString, @columnString
    END
    CLOSE tableBuilder
    DEALLOCATE tableBuilder
    SELECT * FROM @tableBuilder
    Export the results of that as you like.

  • How do I export/import keyboard shortcuts to a text file

    How do I export/import keyboard shortcuts to a text file?
    It would be nice to export them, edit and/or add to them in a text editor on my iMac, then import them back into iPhone and iPad.

    You can backup the bookmarks to a file, then copy that file to the new computer and import them, for details see [[Backing up and restoring bookmarks]].
    You can copy more than just the bookmarks. The user data, such as bookmarks and passwords, are stored in the profile folder. You can copy the data manually by copying the contents of the profile folder, for details see [http://kb.mozillazine.org/Profile_backup Profile backup - MozillaZine Knowledge Base] or [[Backing up your information]].
    There are some add-ons and utilities that can make this process easier. The first one is the [https://addons.mozilla.org/en-US/firefox/addon/2109/ FEBE] add-on which can be used to copy a profile. Another option is the free [http://mozbackup.jasnapaka.com/ MozBackup] utility.

  • How to export the entire databse in a text file !!!

    I have oracle 11g Database and want to export the SH Database as a text file
    What will be the process to export it ?
    links or steps
    Thanks

    I have oracle 11g Database and want to export the SH Database as a text file
    What will be the process to export it ?
    links or steps I think there is no such operation, But you have some alternate.
    1) take export of database
    2) import into SQL file.
    one of example
    http://www.dba-oracle.com/t_data_pump_sqlfile_parameter.htm

  • How to export an imail message to a text file

    I want to edit a long string of emails (over 2000).  is there any way to get those mail messages (no attachments) into a single text file?

    I have oracle 11g Database and want to export the SH Database as a text file
    What will be the process to export it ?
    links or steps I think there is no such operation, But you have some alternate.
    1) take export of database
    2) import into SQL file.
    one of example
    http://www.dba-oracle.com/t_data_pump_sqlfile_parameter.htm

  • Download internal table as text file with comma separation

    hi all
    I wanted text file separated by comma. I used the CSV function module, but the result is separeted by semicolon,instead i need comma.
    Kindly suggest some solution.
    Thanks
    Subha

    use this fm to convert to csv file
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
        EXPORTING
          I_FIELD_SEPERATOR    = ','
        TABLES
          I_TAB_SAP_DATA       = ITAB_FINAL
        CHANGING
          I_TAB_CONVERTED_DATA = ITAB_OUTPUT
        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.
    itab_output is of type ITAB_OUTPUT TYPE TRUXS_T_TEXT_DATA,
    and then download using gui_download
    CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME                = W_FILENAME
            FILETYPE                = 'ASC'
          TABLES
            DATA_TAB                = ITAB_OUTPUT
          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.

  • Uploading into database table from text file using tab (GUI_UPLOAD)

    i have small doubt
    i have 3 fiels in text file using tab as separator
    i need to update into database table 'ZABPSP_01'
    from 's.txt' located in local disk.
    My code is below.
    Please let me know the correction.
    Awaiting for ur response.
    Thanks in advance
    REPORT  ZABPSPPRG_02.
    TABLES: LFA1,MARA,KNA1,ZABPSP_01.
    DATA:  begin of itab occurs 0,
    IKUNNR type zabpsp_01-kunnr,
    IMATNR type zabpsp_01-matnr,
    IADRNR type zabpsp_01-adrnr.
    DATA:END OF ITAB.
    DATA: FILENAME1 TYPE STRING.
    FILENAME1 = 'C:/s.txt'.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FILENAME1
      FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                     = itab.
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF sy-subrc EQ 0.
    zabpsp_01-kunnr = ITAB-IKUNNR.
    zabpsp_01-matnr = ITAB-IMATNR.
    zabpsp_01-adrnr = ITAB-IADRNR.
    WRITE : / ' UPLOAD SUCCESS ' .
    ENDIF.
    \[subject changed, don't write everything in upper case!\]
    Edited by: Jan Stallkamp on Aug 6, 2008 2:39 PM

    Hi,
    After upload modify the code like below. Also change the file name as some one suggested already. If u are still facing problems then check in debug mode what is happening after FM call.
    CALL GUI_UPLOAD FM.
    IF sy-subrc EQ 0
    IF NOT itab[] IS INITIAL.
    MODIFY ZABPSP_01 FROM TABLE itab.
    WRITE : / ' UPLOAD SUCCESS ' .
    ELSE.
    WRITE 'No data in file'.
    ENDIF.
    ELSE.
    WRITE 'Upload failure'.
    ENDIF.
    Thanks,
    Vinod.

  • Loading data from oracle table to text file........

    how can i load data from a oracle table to a text file or CSV file using PL/SQL procedures where the pls/sql code will take the table name dynamically.........
    soumen

    Try this thread..
    Is it possible to export a pl/sql region as a csv file?

  • Export data as fixed length ASCII text file

    Hi,
    Can someone tell me how to export query data or the data in a table as a fixed length text file. I use PL/SQL developer to query the data.
    Many thanks,

    If you use SQL*Plus, you could try the following.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch7.htm#1007441

  • How to export report to excel and to text file in previewer

    How to export report to excel?
    And, it takes long time for generate report to rtf or pdf file in previewer.
    How to speed up the process? or, it's better generate report to text file directly by Run_product?
    Please help!

    You can generate report to tab delimite format that can be imported to excel.
    As for the performance question, because reports can't specify what format when you run against previewer, so I don't know what previewer you are talking about. Generate to file is always faster than to your application previewer (assume) because you have one more step after output generated in the file: read from file and render it. Depends on the render and size of the output, it may have significant performance difference.
    Thanks,
    -Shaun

  • Upload data from Internal table to text file with  '~' separator

    can anyone help me to download data from internal table to flat file with  ''  separator. GUI_DOWNLOAD is not working in my case ....like for ''  separator

    Here it is
    REPORT  zkb_test1.
    TYPE-POOLS: truxs.
    DATA: i_scarr TYPE TABLE OF scarr,
    i_conv_data TYPE truxs_t_text_data.
    SELECT * FROM scarr INTO TABLE i_scarr.
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
      EXPORTING
        i_field_seperator    = '~'
      TABLES
        i_tab_sap_data       = i_scarr
      CHANGING
        i_tab_converted_data = i_conv_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.
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        filename                = 'C:\Test1.txt'
        filetype                = 'ASC'
      CHANGING
        data_tab                = i_conv_data
      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
        not_supported_by_gui    = 22
        error_no_gui            = 23
        OTHERS                  = 24.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Regards
    Kathirvel

  • Write to a specific line in text file

    hi let say text file with five lines
    i need to write it in a specific line example line 3.
    how to do tht,
    thk u

    In Mike's example, you cna change the constant 2 to a control which allows ytou to select which line to write to.
    2 meaning the third position becasue indexing starts at 0. 

  • Find and edit specific line in text file?

    Hello I want to read a text file that could look in some different ways since the user choose file from a list. I then want to igonre all the lines that begin with a special character, for example %. I then want to find all the lines "words" that begin with TRY for example and put those "words" in a string or array. If there is one line that contains TRY100 and anoter line that contains TRY200 I want to find those words and display them. How do i do this?

    First you read the entire file.  Use the Read Text File.  Right-click on it and select the option to Read Lines.  The the count to read to -1 (read all).  You will now have an array of strings, one item for each line of your file.
    Now you need to play the filter game.  I recommend using FOR loops with Autoindexing tunnels.  Assuming you are using 2012 or later, have the output autoindexing tunnels use the conditional tunnel.
    Give this a try and see where you can go.  Post back with what you have tried and tell us where you are stuck.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Problem with pasting table into text file as text. 09 is different from 08?

    Okay, here's what I'm doing. I've got a table in Numbers which I want to make into a table on a web page. Here's what used to work with Numbers '08 and OS 10.5:
    Select cells. Copy.
    Open TextEdit.
    Paste and Match Style.
    Make Plain Text
    Save As (filename)
    Open PageSpinner
    Go to Table Assistant and Insert File (filename)
    Now I have a new computer, running 10.6 and Numbers '09. And when I insert the file as a table into PageSpinner, I've got a special character littered throughout. Specifically, line breaks seem to be replaced with delete characters (the right-pointing pentagon with an x in it).
    So what has changed, and how can I cope?
    --Dave

    Hi Dave,
    You can try reporting your own post and asking the moderator to delete it for you. Click the link in the lower right corner.
    Jerry

Maybe you are looking for

  • How can I make a label for my chart that changes dynamically when I drag selection of data to adjacent column?

    I have a custom budget using Numbers '08 and have labeled a chart in previous versions of my budget but when I tried to update it for the new year I can't figure out how to make the label change dynamically as I drag the selected area to the adjacent

  • Calculating CMYK color coverage

    Hi guys! I am trying to write a simple plug-in to calculate the color usage of a given PDF page.The end result should be percentages how much of the page is covered in C, M, Y etc. Problem is I don't really know what the smartest approach to do it...

  • Refresh system matrix

    I have added a user defined field at the row level.I am performing some calculation on this udf in the goods receipt po form.I need to refresh this system matrix after performing calculations.Is it possible to refresh system matrix programatically ?

  • Logo to MS CRM 2011

    How can I add my company logo to MS CRM 2011 header? In 4.0 we used to change the image. But in 2011 that image appears in the middle of the header. how can make this left align?

  • Error specifying spry xml data source?

    I have been using Dreamweaver's Spry XML Data Sets without any trouble until I added the calendar YUI widget. After that I get an error message "no expected entity name for reference (65, 23)". Also nothing shows in the Bindings Panel. I have a Mac O