Problems inserting huge ammount of lines in a table

Dear all:
I have a process that reads data from one table (table A), makes some calculations and writes the modified data into another table (table B).
For each line on table A the process will write from 1 to 4 lines in table B. The calculation is VERY simple.
The process reads 1 million lines from table A and writes 4 million lines into table B, and I need to do this in 2 hours.
I have a sun/solaris server with 8 processors and an EMC storage (the machine is really fast), but I can not complete the process in a reasonable time.
The problem is that after 15 minutes the Oracle Database slows A LOT. If I query the v$session_wait view, I receive "log buffer wait" messages, and there is nothing I can do to solve this problem (many DBAs tried to solve it).
Is there a special way to insert a huge amount of data into a table in a fast way?
I really appreciate any help!

I am extracting once from the source and inserting into the destinations table making calculations from the cursor variables.
I heard that the problem is a big contention at the Oracle i/o slave. I will try to use direct load and paralellize the process, I hope this can work!
Thank you!
Josi,
Since you are extracting from one source table and inserting into a target table, and you mentioned your are generating for each source 4 rows into the target, i like know knwo what your OWB mapping look like; i.e. how did you model the "row-multiplier" in the OWB mapping editor.... using a splitter like this:
+----> Calculate()-->Target1
+
Source1 ---> Splitter +----> Calculate()--> Target1
+
+----> Calculate()--> Target1
+
+----> Calculate()--> Target1
If you use the splitter and run the map in set-based mode, you are effectively extracting the table Source1 four times... quite costly... you probably get better performance by running the map in row-based mode and using the bulk mode..... again my recommendations are based on guesses what your mapping looks like and where/when you do the calculation in the dataflow graph.
In 9i there is a multi table insert statement which will provide you with a set-based splitter operation; we will make support available for multi table insert in our upcoming release.

Similar Messages

  • BAPI_PR_CHANGE (Not Able to insert more than 3 Line Items)

    Hi Friends,
    I have Issue with BAPI_PR_CHANGE.
    I could Able to insert up to 3 lines items using this BAPI but if I am Trying to Insert More Than 3 BAPI throwing Dump.
    Any Idea on this?
    Any Parameter I need to pass for more than 3 line items.
    Let me know any help on this BAPI...I am on ecc 6.0.
    Thanks,
    Yogesh Patil

    We are on ECC 6.0 and have no problems creating a PR with 100+ line items or adding multiple lines to a existing PR . Please paste the first page of the dump to help me answer your question.
    Thanks,
    Raj

  • Can't insert line into a table

    Hi every, I got a problem which is simple for you.
    In se16 when I want to insert a line of a table, from the second line it dosen't allow me to insert with an error message: data record exists already with the key indicated. What's that?
    Thanks!

    Hi!
    I can imagine it like that, you have to append a new key column into your table:
    1st key field: LANGUAGE
    2nd key field: LINE_COUNTER
    So you can enter into the table entries like these:
    EN 0001
    EN 0002
    EN 0003
    and so on...
    In a table it is not allowed to have 2 lines with the same key.
    Regards
    Tamá

  • Problem insert JDBC Tables...

    hello all !
    I`m Sorry by open a new Thread about this problem ...but is very urgent !
    I have Two problems..
    1 - I need to insert in SQLServer 4 tables CRHE, CRFT, CRFV, TLINES !
    CHRE is only one data - Father Table ! its OK !
    The tables CRFT, CRFV exists many VML segments, but insert only one line in database ..only the first XML elements is inserted ...How a can to make to insert all xml segments for these tables !
    2 - I have problem is TDLINE Table --> i need to concatenate the items of TDLINE ...If you to analyze 3 first fields CRID, FTNO, FVNO are equal because of the key ok?
    The Last field TDLINE was broken in segments of the XML and I need to concatenate this fields to insert an one only line of the database !
    this is the XML come from R/3:
    thank you very much for help !
    Boni.

    Hi !
    Yes ..multiple items in RFC ...to insert all in DataBase !
    My problem is that insert only the first item ...hoe i do to insert all???
    I change the structure of XML Receiver Structure  !
    This is my complete XML Receiver Structure:
    statement_TABELA2           1 (ocur)
    CRFT                        O..unbounded
    action(Insert)              optional
    access                      0..unbounded
    CRID                        0..1
    FTNO                        0..1
    FTTYP                       0..1
    COSTR                       0..1
    VORNR                       0..1
    FTRNR                       0..1
    This is Rigth ??? ...you can Show me how i can make this !!
    Thank You...

  • How to display the data in PDF format : problem is splitting into 2 lines

    Hi ,
    I developed one report which downloads the data into PDF format and saved in C drive but my problem is
    in my program : Line size of the report is 255 in PDF it is splitting into 2 lines. it has to show in a single line. how to do it. how to reduce the width of the output? i am sending my code below. anybody can suggest me how to do it. if possible please send me the code.
    my code:
    report zmaheedhar.
    maheedhar-start
    TABLES : vbak.
    parameters : p_vbeln type vbak-vbeln.
    data : begin of itab occurs 0,
            vbeln type vbak-vbeln,
            ERDAT type vbak-erdat,
            ERZET type vbak-erzet,
            ERNAM type vbak-ernam,
            ANGDT type vbak-angdt,
            BNDDT type vbak-bnddt,
            AUDAT type vbak-audat,
            VBTYP type vbak-vbtyp,
            TRVOG type vbak-trvog,
            AUART type vbak-auart,
            AUGRU type vbak-augru,
            GWLDT type vbak-gwldt,
            SUBMI type vbak-submi,
            LIFSK type vbak-lifsk,
            FAKSK type vbak-faksk,
            NETWR type vbak-netwr,
            WAERK type vbak-waerk,
            VKORG type vbak-vkorg,
           end of itab.
    maheedhar-end
    DATA: pripar TYPE pri_params,
          arcpar TYPE arc_params,
          lay TYPE pri_params-paart,
          lines TYPE pri_params-linct,
          rows TYPE pri_params-linsz.
    DATA: val(1), val1(1).
    *---> Local Printer Name defined in SAP, Change NHREMOTE to your local printer
    DATA: dest TYPE pri_params-pdest VALUE 'ZNUL'.
    DATA: name TYPE pri_params-plist VALUE 'Testing'.
    DATA: i_pdf TYPE STANDARD TABLE OF tline.
    DATA: spono TYPE tsp01-rqident.
    maheedhar-start
    top-of-page.
    write: 'Sales Document' , 'C Date', 'Entry time', 'Created By','Quotation date',
           'Date','Document Date','SD document category','Transaction group','Sales Document Type',
           'Order reason'.
    start-OF-SELECTION.
          select vbeln  ERDAT ERZET ERNAM ANGDT BNDDT AUDAT
                  VBTYP  TRVOG AUART AUGRU GWLDT SUBMI LIFSK
                  FAKSK  NETWR WAERK VKORG from vbak
            into table itab
            where vbeln = p_vbeln.
    maheedhar-end
    --- Retreive local printer details
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        destination            = dest
        no_dialog              = 'X'
        immediately            = ' '
      IMPORTING
        out_archive_parameters = arcpar
        out_parameters         = pripar
        valid                  = val
        valid_for_spool_creation = val1
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *-- Set Spool printer details w.r.t local printer
    pripar-prdsn = 'DSN'.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        in_archive_parameters    = arcpar
        in_parameters            = pripar
        no_dialog                = 'X'
        list_name                = name
      IMPORTING
        out_archive_parameters   = arcpar
        out_parameters           = pripar
        valid                    = val
        valid_for_spool_creation = val1
      EXCEPTIONS
        archive_info_not_found   = 1
        invalid_print_params     = 2
        invalid_archive_params   = 3
        OTHERS                   = 4.
    IF sy-subrc EQ 0.
    ---> Triggers the spool creation in the sense all the write statements from hereon will be written to spool instead of screen
      NEW-PAGE PRINT ON
      NEW-SECTION
      PARAMETERS pripar
      ARCHIVE PARAMETERS arcpar
      NO DIALOG.
    ELSE.
      WRITE:/ 'Unable to create spool'.
    ENDIF.
    *--- Output statements
    *WRITE:/ 'First Line', 'mahee','lklk','kikik','lokiuj','fffff','kijuyh','fgfgfgfg','gtgtgtgtgtgtgtgtggggggggggggggggggggggggggggggg'.
    *WRITE:/ 'Second Line'.
    LOOP at itab.
    write: itab-vbeln,
            itab-ERDAT,
            itab-ERZET,
            itab-ERNAM,
            itab-ANGDT,
            itab-BNDDT,
            itab-AUDAT,
            itab-VBTYP.
    ENDLOOP.
    "---> Close spool
    NEW-PAGE PRINT OFF.
    spono = sy-spono.
    Convert ABAP Spool to PDF
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid                    = spono
        no_dialog                      = 'X'
    TABLES
       pdf                            = i_pdf
    EXCEPTIONS
       err_no_abap_spooljob           = 1
       err_no_spooljob                = 2
       err_no_permission              = 3
       err_conv_not_possible          = 4
       err_bad_destdevice             = 5
       user_cancelled                 = 6
       err_spoolerror                 = 7
       err_temseerror                 = 8
       err_btcjob_open_failed         = 9
       err_btcjob_submit_failed       = 10
       err_btcjob_close_failed        = 11
       OTHERS                         = 12.
    Download PDF contents to presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = 'c:\test.pdf'
        filetype                        = 'BIN'
      TABLES
        data_tab                        = i_pdf
    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.
    thanks,
    maheedhar

    hi tripat,
    actual problem is what u said it is decreased the wiidht of the output.
    now the output is:
    Sales Document C Date Entry time Created By Quotation date Date Document Date
    SD document category Transaction group Sales Document Type Order reason
    62741 07/29/1996 11:54:38 DARLENE 00/00/0000 00/00/0000 07/29/1996 C
    actual output is:
    output should come in a single line. it is splitting into 2 lines.
    thanks,
    maheedhar

  • Change transaction using BDC-problem for large number of lines on screen

    Hi All,
    I am developing BAPI (using BDC) which creates quality notification in SAP which is entered via front end web application. Structure p_qmsm contain 3 lines of task in notification. The code is as given below. To avoid problem of large no of lines on screen,code lines starting with * is used. This actually for pagedown after entering every 2 lines and creates new line. so that 2 lines always push up on screen and there will not be problem for creating large no of lines on screen
    perform bdc_dynpro using 'SAPLIQS0' '7200'.
    perform bdc_field using 'BDC_OKCODE' '=10\TAB11'.
    LOOP AT p_qmsm INTO wa_qmsm.
    *IF wa_qmsm_cntr > 2.
           wa_qmsm_cntr = 2.
           perform bdc_dynpro  using 'SAPLIQS0'                   '7204'.
           perform bdc_field   using 'BDC_OKCODE'                 '=PEND'.
    ENDIF.
    perform bdc_dynpro using 'SAPLIQS0' '7204'.
    perform bdc_field using 'BDC_OKCODE' '/00'.
    CONCATENATE 'VIQMSM-QSMNUM(' wa_qmsm_cntr ')' INTO wm_qmsm_qsmnum.
    CONCATENATE 'VIQMSM-MNGRP(' wa_qmsm_cntr ')' INTO wm_qmsm_mngrp.
    CONCATENATE 'VIQMSM-MNCOD(' wa_qmsm_cntr ')' INTO wm_qmsm_mncod.
    CONCATENATE 'VIQMSM-MATXT(' wa_qmsm_cntr ')' INTO wm_qmsm_matxt.
    perform bdc_field using wm_qmsm_qsmnum wa_qmsm-qsmnum.
    perform bdc_field using wm_qmsm_mngrp wa_qmsm-mngrp.
    perform bdc_field using wm_qmsm_mncod wa_qmsm-mncod.
    perform bdc_field using wm_qmsm_matxt wa_qmsm-matxt.
    wa_qmsm_cntr = wa_qmsm_cntr + 01.
    ENDLOOP.
    CALL TRANSACTION 'IQS2' USING wt_bdc
    MODE 'N' UPDATE 'A'  MESSAGES INTO P_MESSTAB.
    The same code is used in modify mode also. web application is sending all 3 lines in modify mode even if single line is modified. It is already decided to send all rows back from web application to SAP in same sequence. It is working fine if i comment 5 lines which is starting with *. But in modify mode, how can i ensure that correct row is modified? and how can i achieve problem of large no of lines on screen?Please suggest?

    Hi yogesh,
    how can i ensure that correct row is modified?
    1. For this we need to know two things ;
       a) the database table in which the entries are already stored
       b) the sequence in which they are displayed in the transaction.
    2. So before changing any line, we need to compare (the primary key values / important values)
       a) as per the database table and as per the incoming data from web application (using bapi)
      b) if the match is ok, it means that particular row was not modified, else modified.
    how can i achieve problem of large no of lines on screen?
    1. For this I am  not sure about the transaction and its screen. Manytimes for appending row on the screen,
      there is a PLUS + button on the grid toolbar. So for every entry, (inspite of some empty/filled rows already visible on the screen), we should use the + button, and this new row always appears on the top i.e. row number 1.
    hope this helps.
    regards,
    amit m.

  • Problem inserting .swf in dreamweaver 8.Help!!

    Hi everybody.I have a problem since a lot of time jaja.I habe
    problems inserting .swf files in dreamweaver 8.I can insert, when I
    press f12 to see in Internet Explorer you see the movie, but when
    you put mouse over the banner I design.This has a bad behavior, it
    transform to hand, because the banner is a buttom, and again
    transform in default mode and it doesn`t stay in buttom form.When I
    did the flash, I saw the .sfw file in HTML, that generated the same
    Flash, and it look good, and had a hood behavior, but when I insert
    in dreamweaver 8 it doesn`t work correctly.I download the
    Dreamweaver 8 Update 2. Now I have Dreamveaver 8.0.2 or something
    like that.
    I think that the problems is in the form that Dreamweaver
    Insert the .swf file.
    My way is Insertar - Media - Flash.
    Somebody can help me? this problem I can´t resolved and
    I new whit this.
    English is not mi first Language, sorry if I had mistakes.

    ok....
    i installed php 5.2.10
    and downloaded php-5.2.10 zip file i found .dll
    its ok
    but in next help topic (testing PHP installation (Windows) )
    [http://livedocs.adobe.com/dreamweaver/8/using/gs_18_q7.htm]
    i didnt gt the result...
    what may be the problem?
    plz advice
    thanks in advacne

  • How can I do to insert a 1D array in a line of a table or a 2D array ?

    I have some vectors I concatenate in a 1D array when I pushed a button. Furthermore, when I pushed the same button, I would like to insert this 1D array in a line of a 2D array or in a line of a table. How can I do ?
    Thanks.
    Cyril.

    Hi,
    to insert 1D array into 2D array you must use
    Functions->Array->Insert Into Array.
    Wire your 2D array to array input of this vi, then specify the row index you want your 1D array will be, and then wire your 1D array to element input. The output will be what you want. The length of all 1D arrays must be the same, otherwise you may loose some data.
    If you want to add data to text table then you need first to convert your numeric array to textual form with
    Function->String->String/Number Coversion VIs
    Good luck.
    The example is attached.
    Oleg Chutko.
    Attachments:
    Insert.vi ‏17 KB

  • There was a problem inserting the Service Request: null

    I am trying out service desk. When I try to create a request I get:
    There was a problem inserting the Service Request: null
    I can't see what the issues is. All fields marked in red are filled.
    Tom

    Thomas,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • Any ideas how I can insert a pdf into word, using the insert object option. However the pdf i want to insert has text and lines annotated, but once inserted the comments don't appear????  any help would be greatly appreciated.

    Any ideas how I can insert a pdf into word, using the insert object option. However the pdf i want to insert has text and lines annotated, but once inserted the comments don't appear????  any help would be greatly appreciated.

    You will need to find a forum for MS Word since that is the software that you are trying to manipulate in this.  If you think the processing/creation of the PDF plays a role then you should ask in the forum for the software that you are using to create the PDF.
    This forum is for issue regarding downloading and installing Adobe trial products, so in any circumstance, your issue does not fit in this forum.

  • Job schedule: How to process huge ammount of IDocs ?

    HI,
    we´got a huge ammount (1000-5000 IDocs) of one IDoctype.
    I need a Job with a maximum of 40 IDocs in each job.
    The job looks like:
    1. Step RBDAPP01 with 40 IDocs
    2. Step own report
    Is there any way not to create a new variant for each "40 IDoc group" ?
    I have to create for each IDoc Group(40 pce) a new variant and this is very time spending.
    Is there a better way ?
    Thanks.
    Gordon

    Gordon
    Have you tried using parallel processing ?
    We have processed more than 50,000 IDOC per night, and we use parallell processing. Also we copied program RBDAPP01 and make some specific-company changes.
    Also we change the work process (SM51) of SAP. We opened more bacth queues at night to process faster. We decide to have dynamic work process, open and close automatically according our needs.
    You shold carefull to avoid self-blocking data of transaction involved. I think you should try parallell processing or increase the amount beyond 40.
    Regards..
    Luis

  • Lines of a table control are more than one table control problem.

    Hi All,
       I'm writing a screen which includes a table control and below is my code:
    PROCESS AFTER INPUT.
      LOOP AT gt_blds.
        CHAIN.
          FIELD gw_bld-ebeln.
          FIELD gw_bld-ebelp.
          FIELD gw_bld-quanty.
          MODULE get_item ON CHAIN-INPUT.
        ENDCHAIN.
    endloop.
    The get_item was used to summary the total quanty of each PO item.
    The problem is that once the lines of gt_blds is 16 and my table control lines is 14, the  get_item module will only calculate from line 1 to line14, the last 2 lines was lost...
    Can anyone help me?

    Hi,
    PROCESS AFTER INPUT.
      LOOP AT gt_blds.
        CHAIN.
          FIELD gw_bld-ebeln.
          FIELD gw_bld-ebelp.
          FIELD gw_bld-quanty.
          MODULE get_item ON CHAIN-INPUT.
        ENDCHAIN.
    **add one more module.
    module modify_tabcontrol
    endloop.
    in program.
    module modify_tabcontrol.
    describe table itab lines tc-lines.
    if tc-current_line > tc-lines.
    append itab.
    else.
    modify itab index tc-current_line.
    endmodule.
    even you cannot acheive this.
    add one more module after the loop statement
    module count_qty.
    in program
    module count_qty.
    *here you sum up or whatever you want
    endmodule.
    Regards
    Ramchander Rao.K

  • Problem inserting flash from flash 8

    I am using flash 8 and dreamweaver 8. When I place a flash
    header into my web page there is a space created between the header
    and the lower content on the page. My publish setting in flash are
    set at default. Thanks for any help.

    This could be a problem w/ the Screen Mimic file because I have no problem inserting other flv files supplied to me by others.
    That would my guess too. Here are few other things to consider:
    1)  Does your FLV filename contain any spaces or special characters?  If so, rename it without spaces as these can cause problems.
    2)  Output Screen Mimic project to a QuickTime MOV file.  Then use Adobe Flash Encoder to convert the MOV to FLV.
    3)  When you tested your page, was it a live page on remote server?  Did you upload the page and all supporting files to server (Scripts folder, SWF, FLV...)?
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • Problem Inserting Flash Video (flv) File into Site

    Hi -
    I'm having problems inserting a Flash Video (.flv) into my webpage.  I'm using Dreamweaver 8.
    I'm going to: Insert -  Media - Flash Video, browsing to the .flv file that's in my local site folder, entering the settings.
    In Dreamweaver, there's a big gray box w/ flv icon in the middle.  But when I go to preview, the screen is empty, no video.
    I'm creating the .flv file w/ Screen Mimic (a screen capture recording software).  This could be a problem w/ the Screen Mimic file because I have no problem inserting other flv files supplied to me by others.  This is the first video that I've made that I'm trying to insert. 
    If anyone has any suggestions, I would be most appreciative.
    thanks!
    Stacey Stanley

    This could be a problem w/ the Screen Mimic file because I have no problem inserting other flv files supplied to me by others.
    That would my guess too. Here are few other things to consider:
    1)  Does your FLV filename contain any spaces or special characters?  If so, rename it without spaces as these can cause problems.
    2)  Output Screen Mimic project to a QuickTime MOV file.  Then use Adobe Flash Encoder to convert the MOV to FLV.
    3)  When you tested your page, was it a live page on remote server?  Did you upload the page and all supporting files to server (Scripts folder, SWF, FLV...)?
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • RegisterOutParameter - setBinaryStream - Problems inserting Blob - setRAW

    As posted in metalink (was: "Problems inserting BLOB/InputStream with ojdbc14.jar for 10g - Data size bigger than max size for this type"):
    Using setBinaryStream for large Blobs works as long as I don't register outParameters.
    Query that works: "INSERT INTO blobtest (attachment_id,name,data) VALUES(blobtest_SEQ.nextval,?,?)";
    Query that fails = "BEGIN INSERT INTO blobtest (attachment_id,name,data) VALUES( blobtest_SEQ.nextval,?,?) RETURN attachment_id INTO ? ; END;"
    The necessary tables were created by hand:
    CREATE TABLE blobtest ( NAME CHAR(255), data BLOB, attachment_id NUMBER(38))
    And
    CREATE SEQUENCE TBL_ATTACHMENT_SEQ
    The output was: <<user: SEE
    pw: QD
    instantiating oracle driver
    query: INSERT INTO blobtest (attachment_id,name,data) VALUES(TBL_ATTACHMENT_SEQ.nextval,?,?)
    uploaded no Return Parameter blob of size: 256809
    query: BEGIN INSERT INTO blobtest (attachment_id,name,data) VALUES(TBL_ATTACHMENT_SEQ.nextval,?,?) RETURN attachment_id INTO ? ; END;
    java.sql.SQLException: Datengr÷&#9600;e gr÷&#9600;er als max. Gr÷&#9600;e f³r diesen Typ: 256809
    at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :125)
    at
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :162)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setRAW(OraclePreparedState
    ment.java:5342)
    at
    oracle.jdbc.driver.OraclePreparedStatement.setBinaryStreamInternal(Or
    aclePreparedStatement.java:6885)
    at
    oracle.jdbc.driver.OracleCallableStatement.setBinaryStream(OracleCall
    ableStatement.java:4489)
    at BlobTest.writeBlob(BlobTest.java:161)
    at BlobTest.testBlob(BlobTest.java:118)
    at BlobTest.main(BlobTest.java:92)
    error: Datengr÷&#9600;e gr÷&#9600;er als max. Gr÷&#9600;e f³r diesen Typ:
    256809>>
    here the java test case:
    * Created on 25.08.2004 $Id: BlobTest.java,v 1.4 2005/04/22 11:21:11 hauser Exp $
    * as posted in metalink jdbc forum 050405 and responses by
    * [email protected]
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.Types;
    public class BlobTest {
    private static String FILE_NAME = "c:/temp/veryLargeFile.pdf";
    public BlobTest() {
    final static int ORACLE = 1;
    final static int MYSQL = 2;
    private String jdbcUrl = "jdbc:mysql://localhost/test?user=monty&password=greatsqldb";
    private int dbType = ORACLE;
    private Driver driver = null;
    private String user = "";
    private String pw = "";
    public static String SCHEME = "";
    public static void main(String[] args) {
    BlobTest bt = new BlobTest();
    if (args[0] != null) {
    System.out.println("dbType: " + args[0]);
    if (args[0].toLowerCase().indexOf("oracle") != -1) {
    bt.dbType = ORACLE;
    if (args[0].toLowerCase().indexOf("mysql") != -1) {
    bt.dbType = MYSQL;
    } else {
    System.out.println("not yet supported db type: " + args[0]);
    System.exit(99);
    if (args[1] != null) {
    System.out.println("jdbcUrl: " + args[1]);
    if (args[1].trim().length() != 0) {
    bt.jdbcUrl = args[1].trim();
    } else {
    System.out.println("not yet supported jdbcUrl : " + args[1]);
    System.exit(99);
    if (args.length > 2 && args[2] != null) {
    System.out.println("user: " + args[2]);
    if (args[2].trim().length() != 0) {
    bt.user = args[2].trim();
    } else {
    System.out.println("invalid user: " + args[2]);
    System.exit(99);
    if (args.length > 3 && args[3] != null) {
    System.out.println("pw: " + args[3].substring(0, 2));
    if (args[3].trim().length() != 0) {
    bt.pw = args[3].trim();
    } else {
    System.out.println("invalid filename: " + args[3]);
    System.exit(99);
    if (args.length > 4 && args[4] != null) {
    System.out.println("filename: " + args[4]);
    if (args[4].trim().length() != 0) {
    FILE_NAME = args[4].trim();
    } else {
    System.out.println("invalid filename: " + args[4]);
    System.exit(99);
    bt.setUp();
    bt.testBlob();
    public void setUp() {
    try {
    if (this.dbType == ORACLE) {
    System.out.println("instantiating oracle driver ");
    this.driver = (Driver) Class.forName(
    "oracle.jdbc.driver.OracleDriver").newInstance();
    } else {
    this.driver = (Driver) Class.forName("com.mysql.jdbc.Driver")
    .newInstance();
    if (this.driver == null) {
    System.out.println("oracle driver is null");
    System.exit(88);
    DriverManager.registerDriver(this.driver);
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage());
    public void testBlob() {
    try {
    this.writeBlob();
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage());
    * testfunction
    private void writeBlob() throws Exception {
    Connection conn = null;
    PreparedStatement pStmt = null;
    CallableStatement cStmt, cStmt2 = null;
    InputStream in = null;
    try {
    File file = new File(BlobTest.FILE_NAME);
    in = new FileInputStream(file);
    conn = DriverManager.getConnection("jdbc:" + this.jdbcUrl,
    this.user, this.pw);
    conn.setAutoCommit(false);
    String queryWorks = "INSERT INTO " + SCHEME
    + "blobtest (attachment_id,name,data) VALUES(" + SCHEME
    + "TBL_ATTACHMENT_SEQ.nextval,?,?)";
    cStmt = conn.prepareCall(queryWorks);
    System.out.println("query: " + queryWorks);
    cStmt.setString(1, file.getAbsolutePath());
    in = new FileInputStream(file);
    cStmt.setBinaryStream(2, in, (int) file.length());
    cStmt.execute();
    System.out.println("uploaded no Return Parameter blob of size: "
    + file.length());
    conn.commit();
    String queryFails = "BEGIN INSERT INTO " + SCHEME
    + "blobtest (attachment_id,name,data) VALUES(" + SCHEME
    + "TBL_ATTACHMENT_SEQ.nextval,?,?)"
    + " RETURN attachment_id INTO ? ; END;";
    cStmt2 = conn.prepareCall(queryFails);
    System.out.println("query: " + queryFails);
    cStmt2.setString(1, file.getAbsolutePath());
    in = new FileInputStream(file);
    cStmt2.setBinaryStream(2, in, (int) file.length());
    cStmt2.registerOutParameter(3, Types.INTEGER);
    cStmt2.execute();
    System.out.println("uploaded blob of size: " + file.length()
    + " - id: " + cStmt2.getInt(3));
    conn.commit();
    } catch (Exception e) {
    e.printStackTrace();
    System.out.println("error: " + e.getMessage() + "\nname: "
    + BlobTest.FILE_NAME);
    if (conn != null) {
    try {
    conn.rollback();
    } catch (Exception e1) {
    throw e;
    } finally {
    if (in != null) {
    try {
    in.close();
    } catch (Exception e) {
    if (pStmt != null) {
    try {
    pStmt.close();
    } catch (Exception e) {
    if (conn != null) {
    try {
    conn.close();
    } catch (Exception e) {
    and the batch file I use to start:
    @setlocal
    @echo off
    rem $Id: runBlobTest.bat,v 1.2 2005/04/21 15:06:22 hauser Exp $
    set classpath=../WEB-INF/classes;../WEB-INF/lib/ojdbc14.jar;
    echo JAVA_HOME: %JAVA_HOME%
    set JAVA_HOME=C:\PROGRA~1\Java\j2re1.4.1_02\
    echo classpath: %classpath%
    set javaCmd=C:\PROGRA~1\Java\j2re1.4.1_02\bin\java
    %javaCmd% -version
    %javaCmd% BlobTest "oracle" "oracle:thin://@ORADB.yourdomain.COM:1521:t300" "username" "password" "C:\Temp\veryLargeFile.pdf"
    endlocal

    Apparently, this is partially known - with a different stacktrace though:
    <<From: Oracle, Anupama Srinivasan 25-Apr-05 07:15
    Can you please check on Bug:4083226?
    Using the RETURNING Clause is not supported with JDBC. You could embed the statement in PL/SQL Block as in Metalink Note 124268.1 - JDBC Support for DML Returning Clause.
    The Enhancement Request filed on this issue is being considered for Release 10.2
    >>
    And my answer to it.
    Using the RETURNING Clause is not supported with JDBC.This is strange, with just "emptyblob()", it DOES work.
    I guess, our work-around that hopefully is more portable than embedding a "PL/SQL Block" will be to
    1) create the record with an empty blob,
    2) update the blob in a second statement (now, a RETURNING statement is no longer needed)

Maybe you are looking for

  • Why is the connectionUri different in WSManConnectionInfo object for exchange and windows?

    For exchange the connection uri used is :  'http://machineName/powershell' The WSManConnectionInfo object is created in the following way:  WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri("http://machineName/powershell"), "http:/

  • Ssl with Oracle jdbc thin driver on weblogic 9.2

    http://www.oracle.com/technology/products/weblogic/howto/jdbcssl/index.html http://www.oracle.com/technology/tech/java/sqlj_jdbc/pdf/wp-oracle-jdbc_thin_ssl_2007.pdf I had already created the ssl-jdbc connections for Weblogic 9.2 with Oracle 10.2.0.3

  • Itunes plus wont work with giftcard

    I bought a $100 gift card for the apple store a few months ago. Every time, starting yesterday, I want to buy a song, it tells me that I cannot make an Itunes plus purchase with this gift card and I am not authorized to do so. I am authorized, this i

  • Upright mode missing

    I want to use the upright mode that supposedly exists in the raw importer under lens correction > manual, but when I go there, the upright mode is not showing. Does anyone know why this would happen?

  • Partitioning Scenarios Please...

    Dear Gurus, Can you please explain me at what situation we have to go for partitioning.  I feel i have good amount of knowledge on partitioning.  But i dont know when will we get the necessity to partition an info cube.  As many of u would have gone