Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6812585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:27:59+00:00 2026-05-26T20:27:59+00:00

I am trying to debug a DML error that is happening in one environment,

  • 0

I am trying to debug a DML error that is happening in one environment, but not others. The set up is this:

I have about 10 sets of DML operations (bulk-fetch from remote table, bulk-insert into local table), and two of them give DML errors, “Invalid Number” flavour and the other is “PL/SQL: numeric or value error: Bulk Bind: Truncated Bind”.

I tried copying the data to a “good” environment and could not reproduce the same error. So I’m now trying to build a more robust error handler to catch these and help pinpoint which piece of data is giving me problems.

What I have looks like this:

...
loop
    fetch c_some_data bulk collect into v_arr limit v_limit_size;

    forall i in 1..v_arr.count SAVE EXCEPTIONS
    insert into table_abc_1 values v_arr(i);
    exit when c_some_data%notfound;
end loop;
...
exception
    when X_DML_ERRORS then
        declare
            j integer;
        begin
            FOR j IN 1 .. SQL%BULK_EXCEPTIONS.COUNT LOOP
                begin
                   /*only print the KEY fields for this table,
                   this table has (I think) close to 20 fields*/
                   dbms_output.put_line('DML Bulk-operation error: ' ||
                                                         ' Error Code: '||SQLERRM(-SQL%BULK_EXCEPTIONS(j).ERROR_CODE)||'; '||
                                                         v_arr(SQL%BULK_EXCEPTIONS(j).ERROR_INDEX).stage||'; '||
                                                         v_arr(SQL%BULK_EXCEPTIONS(j).ERROR_INDEX).id||'; '||
                                                         v_arr(SQL%BULK_EXCEPTIONS(j).ERROR_INDEX).code||'; ')

                end;

            end loop;
        end;
    when others then
        PKG_EXCPTN.sp_generic_exception_handler;
end;

I’m sure I could just print all of the columns, but the tables are large (some with > 20 columns) and there are 10 blocks of code that could potentially have this problem. It would also require someone to look at each value in the message and see if it matches with the column type (varchar2 vs. number).

Is there an easy way to print the field on which the error occurred and the value that caused the error?

(using Oracle 10g)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:28:00+00:00Added an answer on May 26, 2026 at 8:28 pm

    you could use LOG ERRORS INTO in your DML statement , this will allow you to dump your errors and bad data to a table so you can check them later.

    see: http://www.oracle-developer.net/display.php?id=329

    and: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#BGBDIGAH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to debug a strange issue with users that have LogMeIn installed.
I am trying to debug an ActiveResource call that is not working. What's the
Trying to debug some ajax calls not working properly in IE, i noticed that
Ive been trying to debug this for hours but I was unable to get
I've been trying to debug this error for over three hours now, changing filenames,
I'm trying to debug an application (under PostgreSQL) and came across the following error:
Hi I'm trying to debug a stored procedure through SQL Analyzer and one of
Trying to debug a random error on a rather complex ASP.net page, there is
Trying to debug something that basically .trim()'s, .val()'s and .length's a textarea input as
Im trying to debug application on Acer Iconia but the usb Debugging mode wont

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.