How can i get the failed row numbers in batch insertion?

Afeter execution of batch insert operation into a table, i use OCIAttrGet() to get the error number of insertion, as expected, it returns the correct number. however, when i use OCIParamGet() to get an error handle and then to get the exact failed row numbers , OCIParamGet() returns -2 , means "INVALID_HANDLE". can anyboy tell me why ? how can i get the exact failed rows?
the snapshot of my code :
int errNum = 0;
int nRet = 0;
nRet = OCIAttrGet((dvoid *)m_pIIOdbc->m_pStmtAll,OCI_HTYPE_STMT,&errNum,
          0,OCI_ATTR_NUM_DML_ERRORS, m_pIIOdbc->m_pErrHandle);
if (errNum)
     OCIError* pErrHndl;
     int* pRow_off = new int[errNum];
     for (int i = 0; i < errNum; i++)
     nRet = OCIParamGet(m_pIIOdbc->m_pErrHandle,
OCI_HTYPE_ERROR, m_pIIOdbc->m_pErrHandle, &pErrHndl, i + 1);
     nRet = OCIAttrGet (pErrHndl, OCI_HTYPE_ERROR, &pRow_off, 0,
     OCI_ATTR_DML_ROW_OFFSET, m_pIIOdbc->m_pErrHandle);
          delete []pRow_off;

now the code is :
OCIEnv      *m_pEnvHandle;                    
OCIError      *m_pErrHandle;                         
OCIError     *m_pErrHandle2;                    
OCIServer *m_pSrvHandle;                         
OCISvcCtx *m_pSvcHandle;                         
OCIStmt *m_pStmtExec;
OCIStmt *m_pStmtAll;
OCIError** m_pErrorHndl;     
int* m_pRowOff; //the array that will contain the failed row numbers
int     m_nArrayLength; //length of array in once batch operation
int m_nErrNum; //error number
int m_nSucCount; //successful record number
//initialization
//m_nArrayLength is a parameter passed in, so i can not tell the exact length of the array, dynamic space allocation is needed
m_pErrorHndl = new OCIError*[m_nArrayLength];
m_pRowOff = new int[m_nArrayLength];
//execution
OCIStmtExecute(
          m_pSvcHandle,
          m_pStmtAll,
          m_pErrHandle,
          (ub4)m_nArrayLength,
          (ub4)0, (OCISnapshot *)NULL, (OCISnapshot *)NULL,
          OCI_BATCH_ERRORS
//get successful records number
m_nSucCount = 0;
OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nSucCount,
          0,OCI_ATTR_ROW_COUNT, m_pErrHandle);
//get error numbers
m_nErrNum = 0;
OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nErrNum,
          0,OCI_ATTR_NUM_DML_ERRORS, m_pErrHandle2);
//get failed row numbers into the array
if (m_nErrNum)
          //get failed row numbers into the array
          for (int i = 0; i < m_nErrNum; i++)
               //initiallize error handles               OCIHandleAlloc((dvoid*)m_pEnvHandle, (dvoid**)&m_pErrorHndl,
                    OCI_HTYPE_ERROR, (size_t)0, (dvoid**)0);
               OCIParamGet(m_pErrHandle, OCI_HTYPE_ERROR, m_pErrHandle2, (void**)&m_pErrorHndl[i], i);
               OCIAttrGet (m_pErrorHndl[i], OCI_HTYPE_ERROR, &m_pRowOff[i], 0,
                                        OCI_ATTR_DML_ROW_OFFSET, m_pErrHandle2);
now, if batch insert is executed, eg, there are 10 records to be inserted, thus m_nArrayLength is set to be 10. There are 5 records of the 10 have exist in database, so some of insert operations will fail. After execution, m_nErrNum is 5, and i can get the failed row numbers.Everything seems go well.
However, if batch updata is excuted, eg, 10 records to be updated, m_nArrayLength is set to be 10, and also there are 5 records of the 10 have exist in database. After execution, the OCIStmtExecute() returns 1, m_nErrNum got by
OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nErrNum,
          0,OCI_ATTR_NUM_DML_ERRORS, m_pErrHandle2)
is 0, and m_nSucNum is 5. Why?? how can I get the rows that fail? i have to know which rows do not exist in database??

Similar Messages

  • How do i get the line/row numbers to print on my numbers document?

    how do i get the row/line numbers to print on my numbers spreadsheet?

    Neil,
    You could make a Screen Shot with a cell selected so that the Row and Column tabs are active. That's a poor way to go about it though since the result will be a graphic with rather low resolution.
    Better to make some labels yourself and add them to the Sheet before printing. You can use single row/column tables for this, or Text Boxes.
    Jerry

  • How can I get the selected rows from two ALV grids at the same time?

    I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
    The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
    It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
    As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
    How can I select the rows, then click on just one button, and process the marked entries from both grids?
    Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
    Thanks.

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

  • How can I get the last 18 numbers from this string

    Hi,
    I'm querying this field from a table. How can I only get the last 18 numbers:
    The numbers look like this:
    500000000818118

    If it is always the last 18 numbers just use the Right() function.  Examples:
    Right("500000000818118", 18)
    or
    <cfset mystring = "500000000818118">
    <cfset mynewstring = Right(mystring, 18)>
    or
    #Right(yourquerycolumn, 18)#
    etc.
    Edit:
    Well I just noticed that your example string is only 15 characters long.  Perhaps I mis-understood your question?
    Message was edited by: Miguel-F

  • How can I get the selected row's index of a Jlist wrapped with JScrollpane?

    the problem is that I can use getSelectedIndex() only if the JList is not wrapped in a JScrollPane.
    but in my program the JList IS wrapped in a JScrollPane.
    when I select one item of the jscrollpane I can't catch the event.
    please F1 me.
    Lior.

    What difference does it make if the list is inside a scroll pane or not? If you have a member varialbe that references the list you can call getSelectedIndex when ever you need.
        myList = new JList (...)
        someComponent.add (new JScrollPane (myList));
        //  Then later
        int sel = myList.getSelectedIndex ();And you can always be up on any selection chagnes in the list by supplying it with a ListSelecitonListener.

  • How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account an

    How can I get the phone numbers in contacts to appear with dashes between the first 3 numbers, the next 3 numbers, and the last 4 numbers?  Until very recently
    it did so.  Contacts on my macbook pro does show up this way.  I do have a mobile me account and in the past syncing was no problem.  What setting has changed?

    The phone number format as well as the date language and format and the time format are controlled by the Region Format setting. Go to Settings > General >International > Region Format.  When you change a region format, you can go back one page (to International) and see an example of the date/time/phone number format that your selected region format will produce.

  • I would like to read a text file in which the decimal numbers are using dots instead of commas. Is there a way of converting this in labVIEW, or how can I get the program to enterpret the figures in the correct way?

    The program doest enterpret my figures from the text file in the correct way since the numbers contain dots instead of commas. Is there a way to fix this in labVIEW, or do I have to change the files before reading them in the program? Thanks beforehend!

    You must go in the labview option menu, you can select 'use the local
    separator' in the front side submenu (LV6i).
    If you use the "From Exponential/Fract/Eng" vi, you are able to select this
    opton (with a boolean) without changing the labview parameters.
    (sorry for my english)
    Lange Jerome
    FRANCE
    "Nina" a ecrit dans le message news:
    [email protected]..
    > I would like to read a text file in which the decimal numbers are
    > using dots instead of commas. Is there a way of converting this in
    > labVIEW, or how can I get the program to enterpret the figures in the
    > correct way?
    >
    > The program doest enterpret my figures from the text file in the
    > correct way since the numbers contain dots instea
    d of commas. Is there
    > a way to fix this in labVIEW, or do I have to change the files before
    > reading them in the program? Thanks beforehend!

  • How can you get the schedule of a single reoccurring job with Restart ability in Redwood to pause when it has failed...?

    We need the Request Restart ability when scheduling a single reoccurring job in Redwood. Most of our jobs are scheduled in CHAINs which offers the Final Status Handler on Step level, and the schedule is "paused" when a job in the CHAIN has failed ( the next instance does not populate until the OP MSG has been Replied to) , and once the OPERATOR message is replied to, the CHAIN can resume running again ( desired ) . But we need this same ability when scheduling a single job not in a CHAIN. In our testing, we set up a job with Request Restart chosen on the Error , Killed and Unknown selections on the Restart Behavior Tab. But we found when a job is scheduled say once a day at 8AM, and when it fails, an OPERATOR msg appears allowing a Restart choice ( desired), but the next day's schedule also populates ( undesired) and we do NOT want the schedule to continue on yet because we need a chance to fix the error before the next insance runs for business reasons. So how can you get the schedule of a single reoccurring job with Restart ability in Redwood to pause when it has failed...?

    Hello Fran,
    You can wrap the job chain in a master job chain in the first step and set the final status handler there.
    You can also set the Restart Behavior to 'Stop Submit Frame', in that case you will have to resubmit the job once you are finished troubleshooting.
    Regards Gerben

  • How can I get the chapter numbering in automatic directory

    How can I get the new pages to take over the chapter numbering in automatic directory.

    Hi Peter,
    thank you for the quick answer.
    I'm new in the community therefor I have a additional question is there somebody reading who will take this as an feature for further updates of pages?
    I think this is a"must" for professionell work.
    Marcus

  • I have entered the wrong numbers to put my phone in pass code lock.  However, I didn't set the autolock....how can I get the pass code lock reset?

    I have entered the wrong numbers to put my phone in pass code lock.  However, I didn't set the autolock....how can I get the pass code lock reset?

    Your only choice is to place the phone in DFU mode (search Google for instructions) and restore as a new device.  You will lose all your data.

  • Junit : How can I get the method name (say testMyAddress) that failed

    My code is below
              TestSuite masterSuite = new TestSuite(testClass);
              TestResult result = new TestResult();
              masterSuite.run(result);
                   Enumeration errors = result.errors();
                   while (errors.hasMoreElements())
                        TestFailure error = (TestFailure)errors.nextElement();
                        Test test = error.failedTest();
    /*will give me the class name but how can I get the method that threw the exception.
    I can get fName (that contains the method name) field to get the method,but being private I cannot hold of the field.
    Wondering if there is any easy way to get the method name that threw exception,without writing unneccessary code
                        Class c1 = test.getClass();
    thx
    m

    getting all methods is no good!
    My test class looks like this
    MyTestClass{
    testGoodData(){
    asserttrue(.....);
    testBadData(){
    asserttrue(.....);
    testNullData(){
    asserttrue(.....);
    someHelperMethod(){
    thx
    m

  • I am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier

    i am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier photo please help me to recover my photos

    Well I'll guess you're using iPhoto 11:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • How can I get the edited value from the editor in JTable

    I have a JTextField added as an editor to a cell in JTable.
    I value gets changed when I press enter.
    but in actionPerformed of the JTextField when I say
    String txtEditorValue = txtEditor.getText();
    I am getting the old value. How can I get the edited value? Thanks.

    Hi,
    I guess, your understanding of how JTable works together with its models is not good enough - for example the method getTableCellEditorComponent(...) of the TableCellEditor interface is used to get the component, that should be used as editing component - its second parameter is a value that should be used to setup the editing component - it is normally not the editing component itself.
    JTable uses an underlying TableModel to store the cell values - if you have edited a cell, JTable gets the value of the editing component by itself and stores it in the TableModel using its setValueAt(...) method. To retrieve this data you only need to query the TableModel using row and column of this cell as parameters
    say jt is your JTable, and row and column are the row and column of the cell - so to get the value, simply use
    Object obj = jt.getModel().getValueAt(row,column);
    if you know, that there is a String in this cell use
    String str = (String) jt.getModel().getValueAt(row,column);
    The editor component is used for the view of the JTable - you only want the data, which is stored in the model - you don't have to deal with the GUI components in this case.
    greetings Marsian

  • How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    Hello Arthur,
    Thank you for the reply.
    You were correct that deleting the app and reinstalling it was the only thing to make it work but unfortunately I lost all the documents I made, even though they were backed up to iCloud before i deleted the app. At the same time as deleting pages I had to delete keynote and numbers too, so I've lost all the documents in them too.
    The mb of data which was assigned to each programme in iCloud has reduced, so. I guess they are gone for good. Is there any other way to reaccess them?
    Not your fault but I am a bit fed up the the iPad. I have lost work that I've done and have no other copy apart from what was in iCloud, as I don't have a printer and couldn't email them too myself as I couldn't get into the programme and  i've also got episodes of tv series I purchased that I can't download and albums that are half downloaded with songs missing, so I feel a bit swindled out of time and money and am going back to DVD ,  pen and paper and CDs .
    Instead of using iCloud I guess the only way to make sure I don't loose any more documents it to email them to myself each time I save them on the iPad. Is there anything else you could suggest please?
    I don't have any other apple products apart from iPods, so I can't access the iCloud on anything else can I?
    Thanks
    Amanda

  • I have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    i have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.  Use your backup copy to put everything back.
    If you have failed to bakup, then you can transfer itunes purchases from an ipod: File>Transfer Purchases

Maybe you are looking for

  • Is apple ever going to agree to enable flash?

    there are so many in browser items that require adobe flash, but apple and adobe for some reason are not in agreement in the flash portion of the adobe programs... is there any news of if this is going to change? I severely dislike having to rely on

  • Premiere Pro CC 2014にてpsdレイヤーファイルの読み込みダイアログボックスが出ずに固まります

    恐れ入ります. Windows 7 Professional Service Pack 1 Intel Core i7-4770 CPU 3.40GHz メモリ 32.0GB 64bit NVIDIA Quadro K2000 上記環境におきまして. Adobe Premiere Pro CC 2014 Adobe Photoshop Pro CC 2014 を使用しております. 以前は正常に動作していたのに. 数日前から.下記症状が出ております. ①prprojファイルに.psdファイルを読み

  • Moving files with the Rezound

    Hi would anyone happen to know how to moves files around within the HTC Rezound? Bought a ringtone with the idea of using it for notification alert. Unfortunately it does not show up in the List of available notification sounds just in the list of ri

  • CreationComplete Problems

    If I try to get a mxml componet that has a datagrid in it to render data how do I get the main application page to pull the data with the creation complete in the application file? Here is the componet (resume2.mxml) file code. <?xml version="1.0" en

  • Archive objects

    Hi Friends, I am creating a write program for a custom object, these are the steps i followed. Used FM ARCHIVE_OPEN_FOR_WRITE to get the handle for my particular object. Then, used the same handle, call FM ARCHIVE_NEW_OBJECT, which creates the data c