Save the exception error message

Hi all
Take into consideration the following:
create table WXX_TEST
(
  ID    NUMBER,
  COL1  VARCHAR2(5),
  COL2  VARCHAR2(25),
  ERRMS VARCHAR2(4000)
)
create table WXX_TEST2
(
  ID   NUMBER,
  COL1 VARCHAR2(25),
  COL2 VARCHAR2(4)
)
insert into wxx_test (ID, COL1, COL2)
values (1, 'AA', 'BB');

insert into wxx_test (ID, COL1, COL2)
values (2, 'AA', 'BB');

insert into wxx_test (ID, COL1, COL2)
values (3, 'AA', 'BB');

insert into wxx_test (ID, COL1, COL2)
values (4, 'AA', 'BB');

insert into wxx_test (ID, COL1, COL2)
values (5, 'AA', 'BB');

insert into wxx_test (ID, COL1, COL2)
values (6, 'AA', 'BB');

insert into wxx_test (ID, COL1, COL2)
values (7, 'AA', 'CCCCCCCCCCCC');

insert into wxx_test (ID, COL1, COL2)
values (8, 'AA', 'BB');

insert into wxx_test (ID, COL1, COL2)
values (9, 'AA', 'BB');

insert into wxx_test (ID, COL1, COL2)
values (10, 'AA', 'BB');
so... we're going to do the following:
declare

  cursor c is select id,col1,col2 from wxx_test;

  type t_a is table of c%rowtype;
  l_msg  VARCHAR2(4000 CHAR);
  dml_errors EXCEPTION;
  PRAGMA exception_init(dml_errors, -24381);
  l_errors number;
  l_errno  number;
  l_idx    number;
  v_a t_a;

begin
  
    open c;
    loop
      begin
         fetch c bulk collect 
          into v_a limit 10;
       forall i in 1..v_a.count save exceptions
       
              insert /*+APEND_VALUES*/
               into wxx_test2
               values v_a(i);
               
               
      exception when dml_errors then
          l_errors := SQL%bulk_exceptions.count;
          FOR ii IN 1 .. l_errors LOOP
            l_errno := SQL%BULK_EXCEPTIONS(ii).error_code;
            l_msg   := SQLERRM(-l_errno);
            l_idx   := SQL%BULK_EXCEPTIONS(ii).error_index;
            
            update wxx_test
             set ERRMS =  l_msg || ': ' || l_errno
             where id = v_a(l_idx).id;
          end loop;
          
       end;   
    exit when c%notfound;
    end loop;
   close c;

end;
/
.. .and query the wxx_test table:
select * from wxx_test  where id = 7 
The result is:
       ID COL1                 COL2                                                                             ERRMS
---------- -------------------- -------------------------------------------------------------------------------- --------------------------------------------------------------------------------
         7 AA                   CCCCCCCCCCCC                                                                     ORA-12899: value too large for column  (actual: , maximum: ): 12899
 
We can see that economy exceptions works very well, but we do not know which column is the problem... the error message indicates that the code of the error, not the context.

In contrast, we do the following:
insert into wxx_test2 values(11,'BB','TTTTTTTTTT')
 
ORA-12899: value too large for column "WXX_TEST2"."COL2" (actual: 10, maximum: 4)
Any ideas how to get the context of the error message in the EXCEPTION of SAVING clause?

Have we not all SQL % BULK_EXCEPTIONS options?

DB version: 11g

Thanks in advance,
Alexander.

Published by: a.stoyanov on October 23, 2012 05:30

Tags: Database

Similar Questions

  • JSF/ADF offers all mechinism to manage the exception/error message

    What Struts has everything simply.

    Thank you!

    Kevin.

    Kevin,

    Describe what you mean by ' exception/handle error message', and we will be able to direct you.

    JSF has a standard mechanism to manage the display of messages (the java class FacesMessage and the component of message/messages). ADF Faces, extends the display of messages with an af:messages component. The layer of ADF business components provides a framework for the removal of errors (and their grouping together so that you get all of your messages at once instead of one-at-a-time validation).

    If you can explain what you are looking for, perhaps we can give you more detailed information.

    John

  • I want to save my outlook.pst file but get the following error message:-impossible to copy outlook: the process cannot access the file because another process has locked a portion of the file.

    I want to save my outlook.pst file but get the following error message:-impossible to copy outlook: the process cannot access the file because another process has locked a portion of the file. How can I unlock it please?

    You have Outlook open when you save? You need to close.

    Hope this helps

    Post back if necessary

    ___________________________________________________________

    If this post can help solve your problem, please click the 'bookmark' or 'Yes' to this message button. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Screen saver has an error message preventing the opening

    Screensaver displays an error message prevents the opening. Help

    Hello Robert,.

    I would like to know some information about the problem so that we can help you better.

    What is the full error message when you say, "screen saver has an error message preventing the opening"?

    Thank you for details on the issue.

    I also know that the inconvenience you are experiencing due to problem of screen saver. I will definitely help you.

    This problem can occur because of incorrect or corrupt files of Windows power settings.

    I would suggest trying the following methods and check if it helps.

    Method 1:
    Create a new power plan and check the issue.
    Refer to this article:
    Change, create, or delete a power plan (scheme)
    http://Windows.Microsoft.com/en-us/Windows/change-create-delete-power-plan-scheme#1TC=Windows-7

    If this does not help, use method 2.

    Method 2:
    Run checker (SFC) of file system and see if it helps.
    Reference:
    Use the System File Checker tool to repair missing or corrupted system files
    https://support.Microsoft.com/en-us/KB/929833

    System File Checker is a Windows utility that allows users to find corruptions in Windows system files and restore the damaged files.

    I hope this information helps.

    Please let us know if you need more help.

    Thank you

  • 'Save the exception' does not work... ?

    Hi all

    In why I am not able to catch exceptions of code below... EMP_LOG. Ename size is 100 characters
    --------------------------------------------------------------------------------------------------
    DECLARE

    TYPE EMPTYPE IS TABLE OF THE varchar2 (101)
    INDEX OF DIRECTORY;

    EMPTAB EMPTYPE.

    EXCEPTION MY_EXCEPTION;
    PRAGMA EXCEPTION_INIT (MY_EXCEPTION,-20001);

    BEGIN

    SELECT ENAME
    BULK COLLECT INTO EMPTAB
    FROM EMP;

    EMPTAB (2): = RPAD (EMPTAB (2), 101, ' ');
    EMPTAB (4): = RPAD (EMPTAB (4), 101, ' ');

    FORALL I IN EMPTAB. FIRST... EMPTAB. FINALLY SAVE THE EXCEPTIONS
    INSERT INTO EMP_LOG (ENAME)
    VALUES (EMPTAB (I));

    COMMIT;

    EXCEPTION MY_EXCEPTION THEN

    BECAUSE me in 1... % BULK_EXCEPTIONS SQL. COUNTY
    LOOP
    DBMS_OUTPUT. Put_line ('Record' |) SQL % BULK_EXCEPTIONS (i) .error_index |' original mistake ' | I have |
    ': '|| SQL % BULK_EXCEPTIONS (i). ERROR_CODE | » '|| SQLERRM (-SQL % BULK_EXCEPTIONS (i).) ERROR_CODE));

    END LOOP;

    END;

    --------------------------------------------------------------------------------------------------

    Rgds,
    PC

    Published by: PC Sep 16, 2010 12:39 AM

    Published by: PC Sep 16, 2010 12:44 AM

    1. it is always useful to include the error message you have met.

    2. Please describe the tables EMP and EMP_LOG.

  • Signal Express 2009 causing NIMAX generate an Exception error message

    I have a system which gives an error message when I try to open an instrument in NIMAX. The popup error message shows 'unexpected error', with a code of "MAXKnownException. This system running Windows XP, and we Signal Express 3.0 with 4.3 NIMAX works perfectly. We went to Signal Express 2009 with NIMAX 4.6 and this problem occurs.

    Error log message which is gereated is

    "The niVISAui.mxx plug-in caused an exception in the CmxAggregateItemUI::GetToolbar function in the process of NIMax."

    Thank you

    Some info about failure for future reference, the problem is not benign in the pop up I chose to ignore the error message but any time, I tried to open an instrument in NIMAX I would get the same pop up and NIMAX was virtually unusable.

    The good news is that we were able to get this to work. The Signal Express 2009 package we received came with the associated device drivers CD. Unfortunately, NIMAX on the CD version was 4.5 and it turns out that Signal Express 2009 must have the 4.6 version to work. We took NIMAX version 4.6 out of the web site of NOR and cured the problem.

  • during the game Dungeon Siege Broken World, it stops the game and I get the exception error

    Original title: exception errors

    during the game Dungeon Siege Broken World, it stops the game and I get the error of the exception that the program brings together except for the tour program off that I have to start

    Hi irishlaird,

    1. What is the full error message that you receive?

    2. did you of recent changes on the computer?

    Check out the links and try the steps mentioned below.

    http://garage.gaspowered.com/?q=node/9419

    http://garage.gaspowered.com/?q=node/6386

    http://garage.gaspowered.com/?q=node/5573

    http://garage.gaspowered.com/?q=node/5357

    If the previous step fails, then validate your request on the website of the game provider.

    http://garage.gaspowered.com/?q=Forum/169

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I can't receive emails on Outlook Express. Get the 0x800C0133 error message number.

    I can send and receive Outlook e-mail messages and can send emails on Outlook Express, but cannot receive them on Outlook Express. Get the 0x800C0133 error message number.

    I can send and receive Outlook e-mail messages and can send emails on Outlook Express, but cannot receive them on Outlook Express. Get the 0x800C0133 error message number.   Problem seems to be with the program Outlook Express and think I need to reinstall.  How do you do that?
    Error number: 0x800C0133 = a corrupt Inbox.
     
    Move any message you want to save to a local folder that you create. Then, remove the problem of Inbox as follows.
     
    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.
     
    In Windows XP, Win2K & Win2K3 the OE user files (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder options | View.
     
    With OE closed, find the box of Inbox.dbx and delete it. Another will be created automatically when you open OE.
     
    General precautions for Outlook Express:
     
    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.
     
    After you're done, followed by compacting your folders manually while working * off * and do it often.
     
    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.
     
    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the processors and causes a multitude of problems such as time-outs and account setting changes. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3
  • ADF: addition of the JSF error message: another user has modified the line containing oracle.jbo.Key [185 primary key].

    When you call the function DB. The function performs its operation, but shows an exception. In JDev 11.1.2.3

    And there is not another user. I'm testing alone.

    ADF: addition of the JSF error message: another user has modified the line containing oracle.jbo.Key [185 primary key].

    oracle.jbo.RowInconsistentException: Houston-25014: another user has modified the line containing oracle.jbo.Key [185 primary key].

    The problem is that the function db has a commit and my code also. However the db function called once in a case.

    Thanks a lot for your help.

  • I can't clear the permission and get the following error message: failed to clear approval. Please try again after some time.

    I can't clear the permission and get the following error message:

    Cannot clear permission. Please try again after some time.

    I want to be able to allow so I can transfer files to my torchlight Nook more

    Macintosh:

    1. exit the Adobe Digital Editions software.
    2. Navigate to / Users / / Library/Application Support/Adobe/Digital Editions and drag the activation.dat file to the trash.
      If you use 10.7, see library access hidden files. Mac OS 10.7 and later.
    3. Open Adobe Digital Editions and reauthorize.

    Windows:

    1. Close all applications.
    2. Click Start > run.
    3. Open, type regedit in the text box and press ENTER. The Registry Editor opens.
    4. In the left pane of the registry editor, locate the following registry key: HKEY_CURRENT_USER\Software\Adobe\Adept
    5. Select the key of the follower.
    6. Choose file > export.
    7. In the export registry file dialog box, select the branch selected under export range. Enter a name and location for the backup registry key, and then click Save.
    8. Right click on the key to the follower, and then choose Remove.
    9. In the dialog box confirm the key deletion, click OK.
    10. Close the registry editor.
    11. Open Adobe Digital Editions and reauthorize.
  • Subject: healthreport, about: preferences, about: newtab all give the same error message: the URL is invalid and cannot be loaded. All this since the last update

    Whenever I select all: preferences? entrypoint = menubar #sync, about: healthreport, about: preferences, about: newtab, I get the same error message: "the URL is invalid and impossible to load. All this since the last update tot 50.0 FF. I have tried refreshing Firefox, but to no avail. Help, please. Best regards, mauver

    Hi FredMcD,

    You are the hero of the day. Well, everything seems to work again with the exception of my best websites (which should open when I click on new-tab). But it's only a minor problem and I can easily restore that manually.

    Thanks for your help,

    Mauver

  • [Help] Replace the MySQL error message

    In the form of the insert, I want to put a special, instead of mysql_error error message

    Here is an example:

    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "insert_form")) {}
    $insertSQL = sprintf ("INSERT INTO stuff (title, number) VALUES (%s, %s)," ")
    GetSQLValueString ($_POST ['titla'], "text").
    GetSQLValueString ($_POST ['numbers'], "int"));

    @mysql_select_db ($database_connection, $connection);
    $Result1 = mysql_query ($insertSQL, $connection) or die (mysql_error ());

    cause I get an error like cannot be null

    Thank you.

    [Subject line edited by moderator to make it more explicit]

    If you want to replace the MySQL error message, you can put your own error in quotes in the die() command. Change this:

    $Result1 = mysql_query($insertSQL, $connection) or die(mysql_error());
    

    to do this:

    $Result1 = mysql_query($insertSQL, $connection) or die('Database error');
    

    However, it is not very useful for a user, because all that appears is "Database error" with no indication of what caused the error or sort of a return to the page, except using the browser back button.

    A better way of handling things is to remove the or of the article die (mysql_error ()) code altogether and replace it with a PHP conditional statement that returns the user to an error page if the SQL code fails for some reason any. However, these changes will prevent you to make other changes to the server through the server behaviors panel behavior.

    $Result1 = mysql_query($insertSQL, $connection);
    
    if (!$Result1) {
      $insertGoTo = 'error.php';
    } else {
      $insertGoTo = 'another_page.php' // <-- this is the original $insertGoTo line
    }
    
  • 6.2.16: when you try to update Itunes, I get the following error message: "there is a problem with this package of can I install."  A program required for this install to complete could not be run.  Contact your support team / packages vendo

    6.2.16: when you try to update ITunes on my Windows laptop, I get the following error message: "there is a problem with this Windows Installer package.  A program required for this teaching to complete could not be run.  Contact your supplier of staff or the package of support ".  There is no associated error code.  I've never had a previous issue with ITunes updates.  Thank you, Debbie

    Repair Apple Software Update since the programs & features Panel configuration and then try again.

    For general advice, see troubleshooting problems with iTunes for Windows updates.

    The steps described in the second case are a guide to remove everything related to iTunes and then rebuild what is often a good starting point, unless the symptoms indicate a more specific approach.

    Review the other boxes and other support documents list to the bottom of the page, in case one of them applies.

    The more information box has direct links with the current and recent if you have problems to download, must revert to an older version or want to try the version of iTunes for Windows (64-bit - for older video cards) as a workaround for problems with installation or operation, or compatibility with third-party software.

    Backups of your library and device should be affected by these measures but there are links to backup and recovery advice there.

    TT2

  • photos has not been loaded for weeks (usually the browser chrome on PC windows at work).  I tried now on some other computers and get the same error message and I report every time.  can I do or just wait for someone to fix it

    photos has not been loaded for weeks (usually the browser chrome on PC windows at work).  I tried now on some other computers and get the same error message and I report every time.  is there anything I can do or just wait for someone to fix it?

    If you want any help here, you'll have to tell us what the error message.

    Which report you errors to?

  • Since the change of Tiscali to TalkTalk if I click on links in the emails read on webmail, I get the following error message and then I get disconnected from your

    Since the change of Tiscali to TalkTalk if I click on links in the emails read on webmail, I get the following error message and then I disconnected from TalkTalk webmail.

    HTTP status 404 - /cp/templates/applications/mail/html/null.jsp type status report

    message /cp/templates/applications/mail/html/null.jsp

    Description the requested resource (/ cp/templates/applications/mail/html/null.jsp) is not available. Apache Tomcat/5.5.27

    can you help
    

    Please contact the webmaster. The webmaster will then contact us if they need our help. Thank you!

Maybe you are looking for