Dcom ошибка ora 20101

2029 views
1 min , 21 sec read
0

PROBLEM:

Application team was running some upgrade and during that process, they got the below error. ORA-20101:

ERROR at line 1: ORA-20101: PGIDX is not a ASSM (Automatic Segment Space Management) tablespace,
cannot upgrade BLOB to securefile ORA-06512: at line 28, exiting

SOLUTION:

NOTE – > This solution contains steps, which may block transaction on the table during this activity and indexes might become unusable. For production please take necessary action accordingly.

From the error , it seems PGIDX is not ASSM. Lets check the status.

select tablespace_name,segment_space_management from dba_tablespaces where tablespace_name='PGIDX';

TABLESPACE_NAME             SEGMENT
---------------            -----------
PGIDX                       MANUAL

So first problem is the tablespace is not ASSM,And it is not possible to convert it to ASSM.

So what we can do is find the objects for which we are facing the error.
In our case we are getting error for BLOB. So we searched for the LOB segments in this tablespace.

  1*  select owner,table_name,column_name,segment_name from dba_lobs where tablespace_name='PGIDX'
SQL> /

OWNER        TABLE_NAME                         COLUMN_NAME     SEGMENT_NAME
------------ ---------------------------------- --------------- ---------------------------------------------
PGPLI        GST_PREVVE_CLOCK                   CILEDATA        GST_PREVVE_CLOCK_LOB_SEG
PGPLI        GST_PREVVE_VERSIONS                CILEDATA        GST_PREVVE_VERSIONS_LOB_SEG
PGPLI        GST_DEQ_FENTEXTS                   BONTEXT         GST_DEQ_FENTEXTS_LOB_SEG

So we have planned to move these objects to a new tablespace( Where ASSM is enabled).

create tablespace PGLOB datafile '/u01/data/plob.dbf' size 5g autoextend on;

Tablespace created. 

select tablespace_name,segment_space_management from dba_tablespaces where tablespace_name='PGLOB';

TABLESPACE_NAME             SEGMENT
---------------            -----------
PGLOB                        AUTO


--- Move the LOB segments to a new tablespace 


SQL> alter table PGPLI.GST_PREVVE_CLOCK move lob ( CILEDATA) store as GST_PREVVE_CLOCK_LOB_SEG ( tablespace PGLOB);

Table altered.

SQL>  alter table PGPLI.GST_PREVVE_VERSIONS move lob ( CILEDATA) store as GST_PREVVE_VERSIONS_LOB_SEG  ( tablespace PGLOB);

Table altered.

SQL> alter table PGPLI.GST_DEQ_FENTEXTS move lob ( BONTEXT) store as GST_DEQ_FENTEXTS_LOB_SEG ( tablespace PGLOB);

Table altered.

Now if any indexes on these tablespace are unusable , then rebuild them.

select index_name,status,table_name from dba_indexes where table_name in ('GST_PREVVE_CLOCK','GST_PREVVE_VERSIONS','GST_DEQ_FENTEXTS') and status='UNUSABLE';


-- IF any index reports unusable. then rebuild them using 

alter index pgpli.pg_idx rebuild


Now application team ran the upgrade script and this error was not reported.

 
 

I ran into this error when filling a collection on an Apex login page, which takes a few seconds. Every once in a while, the user would try to log in twice in a row, and get a «ORA-20101: Application collection exists» error. This error is in turn caused by «ORA-20104: create_collection_from_query Error».

The code looked like this:

The scenario:
On the first login, delete_collection completes, and then the create_collection_from_query starts.
The query fed to create_collection_from_query is slow, so while that is still running, the user logs in (i.e. submits the page) again.
On the second login, delete_collection does not run (because there is no collection yet), and then the create_collection_from_query starts.
By the time the second login finishes, the first create_collection_from_query has already completed and has created the collection — hence the exception.

I didn’t find any real solutions on the internet — some came close but were not exactly elegant, like adding an exception «when other then null» and then trying to create the collection again…
I did find a 10 year old community.oracle.com thread that mentions the problem (but doesn’t answer it): https://community.oracle.com/thread/603860. I liked the phrase «if the user becomes impatient and starts pressing the button that creates the collection multiple times then I get the following error» — that described my problem perfectly :-)

I fixed this in two ways.
First, I rewrote the query statement to be faster, and also used create_collection_from_query_b (which is faster than create_collection_from_query); that should give the user less time to login twice.
And I added exception handling, to make sure that the error is not raised if the collection can’t be created during the first login. Note that it will succeed with the second login, so in the end all is well.

The new code:

I have developed a trigger that checks the validity of a date. It works fine because it prevents me from storing an invalid date, but I also get a weird error message and I can’t figure out why. My code is the following:

CREATE OR REPLACE TRIGGER  "CHECKDATEVALIDITY" 
BEFORE INSERT OR UPDATE
ON Event
FOR EACH ROW
BEGIN
IF :NEW.day < 1 OR :NEW.month < 1 OR :NEW.month > 12
    THEN
            RAISE_APPLICATION_ERROR(-20101, 'Wrong date');
END IF;

IF :NEW.month = 4 OR :NEW.month = 6 OR :NEW.month = 9 OR :NEW.month = 11 
    THEN
        IF :NEW.day > 30
            THEN
                RAISE_APPLICATION_ERROR(-20101, 'Wrong date');
        END IF;
ELSIF :NEW.month = 2
    THEN
        IF (mod(:NEW.year, 4) = 0)
            THEN
                IF :NEW.day > 29
                    THEN
                        RAISE_APPLICATION_ERROR(-20101, 'Wrong date');
                END IF;
        ELSIF :NEW.day > 28
            THEN
                RAISE_APPLICATION_ERROR(-20101, 'Wrong date');
        END IF;
ELSE
    IF :NEW.day > 31
        THEN
            RAISE_APPLICATION_ERROR(-20101, 'Wrong date');
    END IF;

END IF;

END checkDateValidity;

The error I get is:

error ORA-20101: Wrong date ORA-06512: on «USER587.CHECKDATEVALIDITY», line 28 ORA-04088: error while executing trigger ‘USER578.CHECKDATEVALIDITY’.

Also I have noticed that I get the error from the line next to the RAISE_APPLICATION_ERROR invoked. What does issue the error?

APC's user avatar

APC

143k19 gold badges168 silver badges281 bronze badges

asked Jun 20, 2011 at 17:55

haunted85's user avatar

5

What do you consider the «wierd error message»? It looks like a perfectly reasonable stack trace to me. At the bottom of the stack, you got an error executing a trigger. The next line tells you that the error happened at line 28. The top of the stack is your custom error message and number. That all seems quite normal to me (though you appear to have cut off some of the error text associated with the ORA-06512 error)

ORA-20101: Wrong date
ORA-06512: on "USER587.CHECKDATEVALIDITY", line 28
ORA-04088: error while executing trigger 'USER578.CHECKDATEVALIDITY'.

If you’re trying to match up the line number, take a look at DBA_SOURCE. For example, this will show you what is on lines 23-32 of your trigger (the offending line +/- 5 lines).

SELECT line, text
  FROM dba_source
 WHERE owner = 'USER578'
   AND name  = 'CHECKDATEVALIDITY'
   AND line BETWEEN 23 and 32;

Of course, I assume this is a classroom exercise and not something you’re doing in the real world. In the real world, you’d store in a DATE column and let Oracle take care of ensuring that a valid date was entered.

answered Jun 20, 2011 at 18:07

Justin Cave's user avatar

Justin CaveJustin Cave

226k23 gold badges364 silver badges382 bronze badges

2

This means you are (by your own rules) inserting an invalid day.

Your trigger is raising ora-20101 if the day is greater than 31, and it does just that.

answered Jun 20, 2011 at 18:09

mukraish's user avatar

  • JDWP-based debugging not supported in this configuration

    I can’t seem to get the debugging feature of SQL Developer to work. I current use Quest SQL Navigator and I can debug with that product just fine. I have set my connection up using the basic tab after reading about a possible bug using the TNS tab. I can connect fine, but when I try to debug I get the following…
    ORA-30683: failure establishing connection to debugger
    ORA-30679: JDWP-based debugging not supported in this configuration
    ORA-06512: at «SYS.DBMS_DEBUG_JDWP», line 68
    ORA-06512: at line 1
    Any ideas?
    I’m running SQL Developer on a Windows XP box and my database is an Oracle 10g running on VMS.
    Thanks

    Has your database schema been granted the privileges to do debug?
    DEBUG ANY PROCEDURE
    DEBUG CONNECT SESSION
    ORA-06512: at «SYS.DBMS_DEBUG_JDWP», line 68
    Mike

  • Row based Target only mode not supported

    when i try to execute a mapping i am getting the following error
    Row based Target only mode not supported
    what can be the reasons for this

    Hello Michael
    Check if you have a procedure (other than pre or post mapping) in your mapping. Every part of a mapping after a procedure can only be generated in row-based mode.
    Hope this helps
    Mate

  • «mode not supported»ATV3 VGA Kanex ATV Pro

    hi
    Apple TV3
    Samsung LED projector via VGA
    Kanex ATV Pro VGA-HDMI convertor
    Macbook Mavericks
    all i get is mode not supported?
    ta
    JJ

    Digger65 wrote:
    thanks
    bit of a shame as this cable/convertor was recommended on these boards by another user and was definately not cheap
    I may have recommended this based on my own experience with it and the fact that it is designed for AppleTV specifically and is actually sold by Apple.
    Have you contacted Kanex support to query what the issue might be?
    Might be worth trying to cycle display resolutions with the remote, see black screen recovery:
    http://support.apple.com/kb/ht3176
    I have not used mine for a few months as I got a new HDMI equipped projector — it is not impossible that Apple have scuppered functionality with a software update though.
    If you cannot get it to work can you return it to the vendor?  I would not have recommended this device if Apple weren’t selling it for this very purpose — even if a software update prevented protected content playback it should not stop you using Airplay of non-protected material.
    My suspicion would be some kind of incompatibility when the device is working out what resolutions the projector supports.  It could even be a faulty Kanex adapter.
    AC

  • MacBook Mini-DVI to VGA — Samsung 32″ LCD — Mode Not Supported

    I followed the instructions on Apple’s site to use the MacBook with the lid closed and an external LCD. It worked perfectly the first time I tried it. (I believe in 1920 x 1024). It seemed a little hard to read so I changed the Display resolution, then encountered the «Mode Not Supported» on my LCD. I unhooked and used my MacBook to change the settings back, but the MacBook seems to revert to the «Mode Not Supported» resolution when I close the lid. Any suggestions? Can I reset the Display Preferences on my MacBook?

    I think this procedure should work, but it requires an external USB keyboard.
    — Shut down the Mac.
    — Have all the following connected:
    — MacBook power supply
    — External display
    — USB keyboard and mouse
    — Open the lid on the MacBook and hit the power button.
    — Immediately close the lid on the MacBook and start holding down the Shift key on the USB keyboard.
    — Release the Shift key once you see the spinning gear on the gray screen on the external display.
    The above procedure should cause the Mac to start in Safe mode and hopefully will finish booting into a useable screen. If that is the case, go into Displays preferences and select a known working resolution different from the one the Mac started up in under Safe mode. Now restart normally. Hopefully the newly selected resolution will persist through the normal restart and you will have a working external screen again.

  • Mid 2010 Macbook Pro to a Samsung Tv. (Mode not supported)

    Hi, I have a macbook pro mid 2010, when connected to an external tv, i get the mirroring option, however when i uncheck the mirroring option (cause i need 2 desktops screen instead of one), my external monitor shows » Mode not supported «. I have a samsung LCD TV. It works perfectly with mirroring option, but I don’t want a mirroring option….. Can anyone help?

    I have a MacBook Pro 15 inch early 2011.
    The new features available in OS X Yosemite like Continuity, Handoff,etc are not supported in this model.
    I did upgrade RAM to avoid any possible slowdown.
    I found replacing the HD with SSD is  too expensive for  a 4 years old model.
    Replacing the CPU/GPU is not for amateurs.
    If you think that rebuilding a Mac part by part is a viable option, please go ahead and rebuild it.
    Best.

  • Monitor says VIDEO MODE NOT SUPPORTED after changing display settings

    HELP! I am about to have a nervous breakdown with my mac mini! I hooked up the mac to my Philips LCD via DVI. No problem at all. But because the screen is only 15″ I wanted to play around with the display settings a bit. So I changed the resolution from it’s original 1204×768 to the one higher (not sure of numbers) and to my HORROR, I now can’t get any picture at all — it says «VIDEO MODE NOT SUPPORTED». I have tried everything I can think of. I have rest the P-RAM, I have unplugged all cables, plugged the back in again, I bought the mac into work and hooked it up to my monitor and changed the resolution back to 1024×768 which is what it was on originally and that STILL didn’t work. I can see the Apple logo and then it goes black and comes up with the error message. HELP! What am I doing wrong — I can’t believe one click of a mouse button has rendered my display useless!!!

    Welcome to Apple Discussions!
    Try booting the mini without the display connected, and then, once the system is running, connect the display. This will often force the system to default to a low resolution, and then correctly detect the display when it is connected.
    If that doesn’t help, with the display connected, boot into safe mode (hold the shift key down when starting up) and once the system is running, change the resolution to 1024×768, and ensure the correct refresh rate is selected. Rebooting normally ought then to give you a good display.
    If all else fails, boot into safe mode with the display connected, and then in the Finder’s file menu, use the ‘find’ option to search for ‘windowserver’ (no quotes). You should get 2 or 3 results, including one with a string of alphanumeric characters. Move all of them to the trash and restart normally.

  • Mac Pro to Samsung HDTV — «Mode not supported»???

    Alright, so I have just received my new Mac Pro in the mail yesterday and wanted to hook it up to my television — a 1080p Samsung (Samsung LN-T4671F) HDTV. I am using a DVI-to-VGA cable. I feel I should probably explain the entire situation so that it’s all clear.
    The first time I started the computer after plugging it into the TV, the Apple logo with the Loading, spinning thing (not the multicolored wheel) showed in beautiful 1920×1080. After loading, the screen jumped to a lower resolution for a second and then went black, finally giving me a «Mode not supported» error. Thinking it was just a little hiccup, I restarted the computer and after the Apple logo screen, it showed me a screen on how to put batteries in my mouse (or something along those lines, I didn’t really look), and then it had me set up my wireless keyboard. After this, it showed me the WELCOME video and allowed me to log on to my computer and start using it.
    After about 15 minutes, I was going through the system prefs and came across display. Thinking maybe I should lower the resolution to better see text, I clicked on a lower resolution around 1600xsomething. The screen went black and gave me the «Mode not supported» error again. I thought I could just wait a few seconds and if I didn’t confirm the resolution, it would go back…but it never did. After trying to restart my computer a number of times and receiving the error message each time, I booted in Safe Mode, which I am in right now.
    I went into the sys prefs and made sure the resolution was set to 1920×1080, which it already was, and restarted the computer. Error again. I went into the settings of my TV and went to PC and had it auto correct the resolution to the input. Error again. I have been running in Safe Boot since — no sound is annoying — and enjoying the display in full 1920×1080 (1080p)…so the set obviously supports it (and the manual says it does too).
    My video card is an NVIDIA GeForce 8800 GT. What’s most annoying is that it’s pretty obvious that the display supports this resolution and yet won’t allow it to work outside of Safe Boot mode.
    Please help

    Had the same problem with an AOC 1080p TV, trying to connect to it using VGA cable.
    Ivan’s earlier post clued me in to solution:
    — Plug in the TV, get the «Mode not supported» message on the TV
    — Open the Display Preferences, you should see the display preferences for the laptop «Color LCD» monitor. Click the «Gather Displays» button — this should bring the display preferences for the TV behind the laptop preferences window. Switch to the TV’s display preferences window.
    — In the TV’s display preferences window, switch refresh rate down to 59.9 Hertz (your TV may need different refresh rate, but on mine I only get options for 59.9 or 60).
    That did it for me!

  • Mode not supported

    one day mac mini working fine connected to Samsung LCD at all resolutions, next day get mode not supported. called samsung, said to play with the resolution setting, which meant that each time I had to disconnect and connect to my 17in computer monitor tried all resolutions with no luck. At start-up apple screen with spinning wheel show on LCD panel but then as it is about to show desktop I get a black screen with message Mode not supported. Any I ideas, it was working perfectly from the the get go without any adjustment basically plug and play.

    Here is the standard Apple article that addresses this type of issue.
    http://support.apple.com/kb/TS2213?viewlocale=en_US

  • When i connect my macbook using the mini hdmi to my HD samsung tv, the response is always «mode not supported».  ideas?

    I’m using the mini HDMI to connec to a Samsung HDTV.  The response is always «Mode Not Supported.»  Anyone know what to do?  Trying to watch TV shows from iTunes on the TV.  Thanks, Hugh

    Hi Jake,
    It’s impossible to know without troubleshooting, but it sure sounds like a bad adapter or cable.

  • «Mode not supported» when connecting MacBook Pro to HDTV

    When I connect my MacBook Pro to the SAMSUNG widescreen HDTV and hit «Detect Displays», it does detect it as VGA Display and it gives me a bunch of options for resolutions and refresh rates, but there was no «Options» tab where I could check or uncheck «Overscan» and even keeping the refresh rate at 60 Hz, and even trying mirrored and non-mirrored screens, nothing worked. It still said «Mode not supported». I used a dual-link DVI to YPbPr cable which I just bought and my friend can connect his MacBook Pro to his HDTV with the same cable, but it doesn’t seem to work for me. What’s wrong?

    Try using an app like to get the stranince resolution:
    SwitchResX – The Most Versatile Tool For Controlling Screen Resolutions On Your Mac
    Display Menu from Mac App Store
    The monitor specs
    Native resolution1440 x 900
    Resolution720p
    Supported DTV resolutions576i
    Supported computer resolutions640 x 480 (VGA)
    PC InterfaceVGA (HD-15)
    Video InterfaceComponent, composite, HDMI, S-Video, SCART
    From:
    http://www.cnet.com/products/samsung-le19r86wd-19-lcd-tv/specs/

  • G5 with samsung 52″ tv  Mode not supported

    Does anyone know how I can make my Powermac G5(single 1.8 ATI Radeon 9800pro) work with my Samsung 52 inch TV at HD resolution
    I am attempting to convert my old Powermac G5 into a media computer. At some point I may want to add a blu-ray drive.
    When I use the DVI on the G5 with a DVI to VGA adapter and connect to the TV via its VGA input. There is no picture and the TV says «mode not supported».
    When I connect a second monitor to the ADC (via ADC to DVI) I can get the G5 to show up on the TV in mirror or extended mode (if I set the resolution to 1024 x 768 or less).
    I have tried hocking up a monitor via VGA, setting the resolution to 1024×768, then shut done, restart with TV attached and still «mode not supported»
    I have also tried making the TV as the main desktop in extended mode then restarting without the second monitor and still «mode not supported»
    I tried a DVI to HDMI adapter but I got nothing «searching for signal» I would assume this should work so it might have been bad so I am going to exchange it and get a new one and try that.
    ?

    I had to do the same, that is, accept a lower resolution for my LCD TV.
    Using a Geforce 6800 GT, I have an interesting mix of «i» and «p» resolutions, but, as with the 9800 Pro, no 1920x1080p.
    Just as well, though, as I couldn’t read the text at highest resolution.
    I’m pretty sure that this is simply a case of the high resolution 16:9 ratios not being supported in these older cards.
    The resolutions that are available in the firmware of the cards are predominately for 16:10 ratio screens.
    Remember, HDTV is a lot newer than most all AGP graphics cards.
    I guess, when I have time, I’ll have to play with DisplayConfigX and see if there is hope.

  • HT201310 what do you do when apple tv says mode not supported

    My apple tv stopped working and the tv says either no signal or mode not supported.  I have restarted, unplugged the HDMI cables and restarted again.  I have not updated any software.  This Apple tv is new since December 14.  The TV I have is older Samsung HD.
    Can anyone assist?
    Thanks

    sounds like you raised the resolution to fullhd 1080p and the samsung can’t cope
    To select a video mode:
    Press and hold both Menu and Menu up/scroll on the Apple Remote for about 6 seconds. Apple TV will cycle through different display resolutions.
    When Apple TV reaches an acceptable display resolution and «If you can see the Apple logo, select OK» appears on your TV screen, press the Play button on the Remote.

  • When I connect Apple TV to my samsung tv, I get a message that says: mode not supported……what doe this mean ? And how do I fix it

    When I connect Apple TV to my samsung tv I get a screen message that says …mode not supported….what does this mean..and how can I fix it ?   Thanks

    I’d start with the following document with that one:
    iPhone, iPad, iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows

  • TV says Mode not supported

    My Apple TV no longer works.  With it on my television says, «Mode not supported.»  Anyone else have this issue?

    Have you tried removing the HDMI cable and trying again, or even trying another cable.

    • Remove From My Forums
    • Question

    • User1041842092 posted

      All,

      New to the forum and new to ASP.net / ODP.net. I have a procedure that I wrote in Oracle that trys to balance an invoice and then throughs an error if the invoice does not balance. I then attempt to capture that specific error message in my vb.net code.
      My issue is that I can capture the error fine but the error message text is returning my custom error and the ORA-06512 that points to where the error occurs…Is there a way for me to just grab my custom error and not the ORA-06512 stuff?

      See below for code shippets:

      PL/SQL Procedure:

      create or replace procedure aodell.OLFM_INVC_BAL(v_invc IN varchar2) is

      c_invc_no varchar2(9);
      c_invc_amt number;
      c_invc_bal number;
      c_error_amt number;
      e_failed exception;

      begin
            select
            invc_no,
            t.invc_tot_amt,
            (nvl(t.promo_alwce_amt,0) +
            nvl(invc_tax_amt1_1,0) +
            nvl(invc_tax_amt1_2,0) +
            nvl(invc_tax_amt1_3,0) +
            nvl(invc_tax_amt2_1,0) +
            nvl(invc_tax_amt2_2,0) +
            nvl(invc_tax_amt2_3,0) +
            nvl(invc_tax_amt3_1,0) +
            nvl(invc_tax_amt3_2,0) +
            nvl(invc_tax_amt3_3,0) +
            nvl(t.dlvry_chrg_amt,0) +
            nvl(t.base_billed_amt,0) +
            nvl(t.invc_tot_accy_amt,0) +
            nvl(t.ppd_min_amt,0) +
            nvl(t.spcl_prc,0) +
            nvl(t.pretax_invc_amt,0) +
            nvl(t.band_plcmt_chrg,0) +
            nvl(t.addnl_feat_chrg,0) +
            nvl(t.appld_trd_cr_amt,0) +
            nvl(t.fsma_extra_chrg,0) +
            nvl(t.ld_dol_amt,0) +
            nvl(t.var_sorter_base,0) +
            nvl(t.var_sorter_prepaid,0) +
            nvl(t.tot_mtr_usage_amt,0) +
            nvl(t.transp_chrg,0) +
            nvl(t.contr_rnwl_disc,0) +
            nvl(accy_base_amt1,0) +
            nvl(accy_base_amt2,0) +
            nvl(accy_base_amt3,0) +
            nvl(accy_base_amt4,0) +
            nvl(accy_base_amt5,0) +
            nvl(accy_base_amt6,0) +
            nvl(accy_base_amt7,0) +
            nvl(accy_base_amt8,0) +
            nvl(accy_base_amt9,0) +
            nvl(accy_base_amt10,0) +
            nvl(accy_base_amt11,0) +
            nvl(accy_base_amt12,0) +
            nvl(accy_base_amt13,0) +
            nvl(accy_base_amt14,0) +
            nvl(accy_base_amt15,0) +
            nvl(accy_base_amt16,0) +
            nvl(accy_base_amt17,0) +
            nvl(accy_base_amt18,0) +
            nvl(accy_base_amt19,0) +
            nvl(accy_base_amt20,0) +
            nvl(accy_base_amt21,0) +
            nvl(accy_base_amt22,0) +
            nvl(accy_base_amt23,0) +
            nvl(accy_base_amt24,0) +
            nvl(accy_base_amt25,0) +
            nvl(t.prem_calc_amt1,0) +
            nvl(t.prem_calc_amt2,0) +
            nvl(t.prem_calc_amt3,0) +
            nvl(t.prem_calc_amt4,0) +
            nvl(t.prod_rconfig_chrg,0) +
            nvl(t.cpy_cr_dol_amt,0) +
            nvl(t.esp_tot_amt,0) +
            nvl(t.eq_guar_mtr_amt1,0) +
            nvl(t.serv_guar_mtr_amt1,0) +
            nvl(t.sply_guar_mtr_amt1,0) +
            nvl(t.serv_guar_mtr_amt2,0) +
            nvl(t.sply_guar_mtr_amt2,0) +
            nvl(t.serv_excs_mtr_amt1,0) +
            nvl(t.sply_excs_mtr_amt1,0) +
            nvl(t.serv_excs_mtr_amt2,0) +
            nvl(t.sply_excs_mtr_amt2,0) +
            nvl(t.cpc_tl_po_amt,0) +
            nvl(t.cpc_tl_carry_chrg_amt,0) +
            nvl(t.serv_excs_mtr_amt3,0) +
            nvl(t.sply_excs_mtr_amt3,0) +
            nvl(t.serv_excs_mtr_amt4,0) +
            nvl(t.sply_excs_mtr_amt4,0)) Invc_Bal
            into c_invc_no, c_invc_amt, c_invc_bal
            from
            aodell.olfm_traeb0_equipbil t
            where t.invc_no = v_invc;

            
            If c_invc_amt <> c_invc_bal then
              c_error_amt := c_invc_amt-c_invc_bal;

              
              raise e_failed;
            end if;     
            exception
              when e_failed then
                raise_application_error(-20101,’Invoice Out Of Balance by: $’ ||  c_error_amt,FALSE);
      end OLFM_INVC_BAL;

      Procedure Output in Oracle:

      ORA-20101: Invoice Out Of Balance by: $100
      ORA-06512: at «AODELL.OLFM_INVC_BAL», line 105
      ORA-06512: at line 2

      Code in VB.net:

      Catch ex As OracleException
                          Select Case ex.Number
                              Case 20101
                                  err = ex.Message.ToString()
                                  Response.Write(err)
                                  ‘disMsgBox(err)
                                  v_invc = invc_no.Text
                                  vSQL = «delete from aodell.olfm_traeb0_equipbil where invc_no  = ‘» & v_invc & «‘»
                                  With cmd
                                      .CommandType = CommandType.Text
                                      .CommandText = vSQL
                                      .Connection = connect
                                      .ExecuteNonQuery()
                                  End With
                              Case Else
                                  v_invc = invc_no.Text
                                  err = ex.Number.ToString()
                                  err = err & ex.Message.ToString()
                                  err = err & » » & v_invc
                                  Response.Write(err)
                                  ‘disMsgBox(«Oracle Error » & err & » has occurred during balancing, see Page Administrator
      for help!»)
                          End Select

      Output of err from above:

      <title>CRR Online File Maintenance</title> ORA-20101: Invoice Out Of Balance by: $100 ORA-06512: at «AODELL.OLFM_INVC_BAL», line 105 ORA-06512: at line 1

      I only want to return the first error — ORA-20101 (the underlined portion).

      Thanks in advance for any help,

      Dan

    Понравилась статья? Поделить с друзьями:
  • Dayz bulldozer ошибка компилятора
  • Dantex конвектор ошибка e1
  • Dallas lock установка драйвера системы защиты ошибка
  • Daewoo ошибка e05
  • D76a ошибка бмв e70