How to raise application error and preserve open cursor...

Hello,
I have to raise an application error under certain circumstances.
In some cases there's an open cursor that has to be read by the calling application anyway because there are data that have to be read.
In other cases the cursor does not have to be read.
sample code:
create or replace procedure get_address(
pv_street varchar2,
pv_number varchar2,
pr_retid in out number,
pr_refcurs in out get_streetpkg.t_refcurs )
v_rowcount number;
v_no_suiting_number boolean := false;
begin
delete temp_addr;
-- get suiting rows
insert into temp_addr
select * from addr
where street like pv_street
and number like pv_number;
v_rowcount := sql%rowcount;
-- if no suiting row found then get all
-- suiting streets regardless of number
if v_rowcount = 0 then
v_no_suiting_number := true;
insert into temp_addr
select * from addr
where street like pv_street;
end if;
-- check whether data has been found
select count(*)
into v_rowcount
from temp_addr;
-- set return id if only one row is found.
if v_rowcount = 1 then
select id from temp_addr
into pr_retid;
end if;
-- open cursor to provide data
open pr_refcurs for
select * from temp_addr;
-- generate error - if no data found at all
-- no data has to be read...
if v_rowcount = 0 then
raise_application_error( -20001, 'no data found' );
end if;
-- generate error - or better notification - message if no number found...
-- SELECTED ROWS HAVE TO BE READ ANYWAY!!!
if v_no_suiting_number then
raise_application_error( -20002, 'streets found, but no suiting number' );
end if;
return;
end;
Prerequisites:
- The calling application reads the open cursor and closes it.
- The application cannot provide additional arguments and the stored proc cannot be converted into a stored func.
- I cannot put the procedure into a package.
- The application has to get information about success or failure (and reason of failure) through provided error numbers (-20999..-20000).
Whenever the error is raised and pr_retid was set, retid is not set in the application, neither is the cursor.
So what can I do to provide return ID and row data???
Hope anyone can help me.
Greetings, Heiko Kaschube
null

Sorry, I didn't read your list of pre-requisites carefully enough. Your problem is that prerequiste #4 (return Application Error number) is in flat contradiction with prerequisite #1 (calling application continues processing).
To restate: RAISE_APPLICATION_ERROR means "the called program has encountered a problem so please cease processing and handle the error". Using RAISE_APPLICATION_ERROR prevents the calling program doing any more processing: control goes to the EXCEPTION handler. Therefore RAISE_APPLICATION_ERROR should only be used for abnormal processing conditions.
I fail to see why you want to use RAISE_APPLICATION_ERROR to handle a situation which is quite obviously not an application error: your called program has found some data that you want to process.
yours in puzzlement, APC

Similar Messages

  • My iTunes program is giving me a message that says, "Runtime error" and wont open iTunes. How do I fix this?

    My iTunes program is giving me a message that says, "Runtime error" and wont open iTunes. How do I fix this?

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • Why do Hyperlinks clicked in Outlook cause General application error and do not open

    When a hyperlink is selected inside an email in Outlook by clicking an error box opens "General Application Error" and it repeats the hyperlink address and says it is a general fault. This is a recent development as hyperlinks used to open a few days ago. Firefox V6 and Outlook V12, both updated today with no change on error.

    Do you have that problem when running in the Firefox SafeMode?
    [http://support.mozilla.com/en-US/kb/Safe+Mode]
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this:
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • Raise Application Error on Dynamic Action

    Hi
    I am using Apex 4.2. On a click of button a Dynamic Action is written, which calls a DB Package. The DB package has exception handlers and also the package has two output parameters
    Error Code and Error Msg
    So in my code(Dynamic Code) i make a call to the package and checks the value for Erroc Code.
    Begin
    Package call......
      If v_error_code <> '0' Then
        Raise SC_Error;
      End if;
    Exception
      When SC_Error Then
        RAise_Application_error(v_err_code, v_err_msg);
    End;
    But when i run the page and I click I get an Internal exception error
    Output from Debug -- I am not sure what the Cell in Red colour means, because the package is returning a correct message (before the red line).Can anyone help please??
    Thanks
    JS
    ......message: AJAX call returned server error ORA-20003: Customer has already been matched for Execute PL/SQL Code.
    4
    ......is_internal_error: true
    4
    ......apex_error_code: APEX.AJAX_SERVER_ERROR
    4
    ......ora_sqlcode: -20003
    4
    ......ora_sqlerrm: ORA-20003: Customer has already been matched
    4
    ......error_backtrace: ORA-06512: at line 41 ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926 ORA-06512: at "SYS.WWV_DBMS_SQL", line 973 ORA-06512: at "SYS.WWV_DBMS_SQL", line 999 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 830 ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN_UTIL", line 2304 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_ACTION_NATIVE", line 442
    4
    ......component.type: APEX_APPLICATION_PAGE_DA_ACTS
    4
    ......component.id: 23185203797756209
    4
    ......component.name: NATIVE_EXECUTE_PLSQL_CODE
    4
    ...Execute Error Handling Callout defined on Page or Application Level
    4
    ...Execute Statement: begin declare l_error wwv_flow_error_api.t_error; begin l_error := wwv_flow_error_api.g_error; wwv_flow_error_api.g_error_result := apx_error_utils.handleerror ( p_error => l_error ); end; end;
    4
    ......Values changed by callout:
    4
    .........message: An unexpected internal application error has occurred. Please get in contact with your system administrator and provide reference# for further investigation.
    4
    .........display_location: ON_ERROR_PAGE
    4
    Stop APEX Engine detected
    4
    Final commit
    4
    1 - 59

    Edit: Well, Patrick beat me to the punch because I was taking my jolly time writing this down
    Well, if you look below the part you put in red, you can see that a callout is made: ...Execute Error Handling Callout defined on Page or Application Level
    With directly below that:
    ......Values changed by callout:
    4
    .........message: An unexpected internal application error has occurred. Please get in contact with your system administrator and provide reference# for further investigation.
    Since the plsql call is on the serverside, this error is trapped within the error handling function aswell. Your error has simply been obscured by it, and probably because it looks at the error backtrace and determines the error is internal.
    Looking at the sample error handling code, this is probably where it goes "wrong":
    -- If it's an internal error raised by APEX, like an invalid statement or
      -- code which cannot be executed, the error text might contain security sensitive
      -- information. To avoid this security problem rewrite the error to
      -- a generic error message and log the original error message for further
      -- investigation by the help desk.
      if p_error.is_internal_error then
    I recreated the situation here, and put some debug in the error handling function just so I could see what sort of error is being processed:
        apex_debug.message('error code: '||p_error.apex_error_code);
        apex_debug.message('sql code: '||p_error.ora_sqlcode);
        apex_debug.message('sql errm: '||p_error.ora_sqlerrm);
        apex_debug.message('error_backtrace: '||p_error.error_backtrace);
    0.05750
    0.00007
    ...Error data:
    4
    0.05757
    0.00006
    ......message: AJAX call returned server error ORA-20099: raise application error for Execute PL/SQL Code.
    4
    0.05763
    0.00006
    ......is_internal_error: true
    4
    0.05769
    0.00005
    ......apex_error_code: APEX.AJAX_SERVER_ERROR
    4
    0.05774
    0.00005
    ......ora_sqlcode: -20099
    4
    0.05779
    0.00006
    ......ora_sqlerrm: ORA-20099: raise application error
    4
    0.05785
    0.00005
    ......error_backtrace: ORA-06512: at line 1 ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1064 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1090 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 832 ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN_UTIL", line 2304 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_ACTION_NATIVE", line 442
    As you can see, the ajax error is an internal error, and that is why it is handled as such in the error handler. With this info you should be able to adjust your handling function. Test for the error code (APEX.AJAX_SERVER_ERROR) and then throw the error message or test for the -20000 range of custom errors for example.
        if p_error.is_internal_error then    
            -- Access Denied errors raised by application or page authorization should
            -- still show up with the original error message
            -- do not parse ajax server errors here !
            if    p_error.apex_error_code <> 'APEX.AUTHORIZATION.ACCESS_DENIED'
              and p_error.apex_error_code not like 'APEX.SESSION_STATE.%'
              and p_error.apex_error_code != 'APEX.AJAX_SERVER_ERROR'
            then
    It probably does need some more work but you should get the gist of it.

  • I keep getting "firefox.exe application error" and program shuts down

    When I attempt to boot up Firefox I get the following message "firefox.exe application error" and the program shuts down. "The application 0x10008d30 referenced memory at 0x10008d30. The memory could not be "read"

    Hello,
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    More information about reinstalling Firefox can be found [https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems?esab=a&s=troubleshooting&r=3&as=s#w_5-reinstall-firefox here].
    <b>WARNING:</b> Do not run Firefox's uninstaller or use a third party remover as part of this process, because that could permanently delete your Firefox data, including but not limited to, extensions, cache, cookies, bookmarks, personal settings and saved passwords. <u>These cannot be recovered unless they have been backed up to an external device!</u>
    Please report back to see if this helped you!
    Thank you.

  • HT5364 Safari 6.1 - Application errors and not useable

    Problem:
    Safari does not load pages with the address bar for one user (originally with Admin rights).  For all other accounts (Standard), Safari loads just fine. 
    Safari 6.1 toolbar loads, page loads but comes up minimized.  Have to go to Window to pull it up, then when it does load, no search bar or favorites.  You can only recall pages from history.  Cannot load Safari-Preferences-Application error and closes.
    Base:
    MacBook Pro, OS X 10.8.5.  Safari: 6.1
    Tried:
    1.  Repair permissions:  Found lots of problems which are apparently fixed.  Downgraded user from Admin to Standard now.  No change in access to Safari for user.
    2.  UnInstall Extensions:  Safari - App Errors out when trying to access Preferences.  First click on Preferences - nothing happens, second attempt to click on Preferences, app errors out.  From a post (reference #2 below), went to Library (/Library/Internet Plug-Ins/) and copied over into another folder on desktop, three (3) extensions and deleted them from folder. - No fix.  Checked other locations (per Ref#2), no extensions found.
    Any help would be greatly appreciated.
    References:
    1. https://discussions.apple.com/thread/2523541
    2. http://support.apple.com/kb/TS3230

    While logged into that Account, open Safari.
    If you are missing the entire Tool Bar..?  Go to: Safari > View > Show Toolbar.
    Or if you are just missing the "Address and Search" Bar from the Toolbar...?  Control (right) click on the Toolbar > select Customize Toolbar > click Add "Address and Search" > then click Done.

  • OSB Customization files 2 set Retry Application Errors and Timeout props

    I know it's possible to set Endpoint URI, Retry Count and Retry Iteration Interval properties using customization files, but what about other properties? I am particularly interested in setting Retry Application Errors and Timeout for a HTTP business services. If it's not possible to do with customization files is there another way of setting them without having to go though each service in the console?
    Edited by: user1019490 on Sep 23, 2010 2:45 AM

    Yes, I guess this can be done as there is provision in ALSBCustomizationFile.xml. Below is the snippet from ALSBCustomizationFile.xml
    <cus:envValueAssignments>
    <xt:envValueType>Service URI Table</xt:envValueType>
    <xt:location xsi:nil="true"/>
    <xt:owner>
    <xt:type>BusinessService</xt:type>
    <xt:path>TestProject/BusinessService/TestBS</xt:path>
    </xt:owner>
    <xt:value>
    <tableElement xmlns="http://www.bea.com/wli/sb/transports">
    <URI>http://www.test.com/testService.asmx</URI>
    <weight>0</weight>
    </tableElement>
    </xt:value>
    </cus:envValueAssignments>
    <cus:envValueAssignments>
    <xt:envValueType>Service Retry Count</xt:envValueType>
    <xt:location xsi:nil="true"/>
    <xt:owner>
    <xt:type>BusinessService</xt:type>
    <xt:path>TestProject/BusinessService/TestBS</xt:path>
    </xt:owner>
    <xt:value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">0</xt:value>
    </cus:envValueAssignments>
    <cus:envValueAssignments>
    <xt:envValueType>Service Retry Iteration Interval</xt:envValueType>
    <xt:location xsi:nil="true"/>
    <xt:owner>
    <xt:type>BusinessService</xt:type>
    <xt:path>TestProject/BusinessService/TestBS</xt:path>
    </xt:owner>
    <xt:value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">0</xt:value>
    </cus:envValueAssignments>
    Regards,
    Karthik

  • Muse cc 2014 - the programme is closing to desktop - different errors i am finding it very unstable - palette errors and _writeSyncCOnn.open ....:SQL error: error

    muse cc 2014 - the programme is closing to desktop - different errors i am finding it very unstable - palette errors and _writeSyncCOnn.open ....:SQL error: error'... connection closed . . . operation:ópen', deatillD:'1001

    also if i copy from a different app then try copy and paste an element in muse cc and paste it the info from the other copy will be pasted in musecc

  • Two Alerts for one scenario: Application Error and No mapping found

    Hello,
    we have a synchronous scenario here embedded in an BPM.
    The last send step step is sync. The receiver is a web service (SOAP adapter) which sends back a response.
    Problem with the response from the service:
    First test: error entries in SXMB_MONI and in RWB
    RWB only shows message "No mapping found".
    SXMB_MONI shows more:
    1 entry for send step (status: log version)
    1 entry for APPLICATION ERROR for response
    1 entry for NO_MAPPING_PROGRAMM_FOUND for response
    APPLICATION ERROR:
    We have changed to trace level 3 now and there are some messages:
    level 3 message type T: Unknown channel type: SOAP
    Don´t know if this matters, because the channel is the sender channel.
    NO_MAPPING_PROGRAMM_FOUND:
    We have checked the whole implementation.
    It is completed w/o anything missing. the required mapping is available.
    No left change list entries to be activated.
    Error text:
    The Interface-Mapping http://xxx.com/xi/global GetDocIDsReq_nach_GetDocIDsResp is not available in runtime cache
    We made more than one full cache refresh but w/o any effect.
    We checked: There are no locks left!
    Does anybody here have experience with this problem or has more ideas what to do?
    Best regards
    Dirk
    Message was edited by:
            Dirk Meinhard

    Hello Dirk,
    We figured out that if you change your message mapping you also have to refresh and save your Interface Mapping.
    To ensure that your messages are equal with your Interfaces and the Message Types you should test the Interface Mapping by using integration Builder.
    If this works you have to check your BPM.
    By using BPM we figured out that if there is a fault in a BPM version the engine will not use this new version.
    To figure out which BPM version is used you have to open the
    Process Monitor à select the process and display the graphic à navigate to EXTRAS and select Workflow Builder. There you will see which BPM is really used. Maybe this is an old one.
    Hope this will show you where the problem is.
    Daniel

  • How to get Application Error descriptions

    Hi, all:
    Our interface has ECC system involved.
    The Message Monitoring in local integration engine shows that there are many messages with application errors.
    I would like to export all messages with application error:
    include message ID and error text.
    Right now, I can export the data from Message monitoring window, but I can not get application error from exported spreadsheet. anyone has idea how to do it ?
    Thanks in advance !
    Liang Ji

    Hi, venkata:
    Thanks for you reply.
    Our scenario is
      ThirdPartySystem ---> SOAP ---> XI ---> ECC (ABAP Proxy)
      Technically, the scenario is running perfect.
    After go-alive, there are many application errors because of the data problem,  e.g.:
    Cannot create order. Service order number already exist
    We know these problem are caused by conversion, now I would like to track each message, so I exported to spreadsheet from Message monitoring.
    But the exported spreadsheet does not include Application Error text, this is the reason I post the question here, do you have idea about it ?
    Thanks
    Liang

  • Error During Delete Of Application:ORA-01000: maximum open cursors exceeded

    Hello All.
    I am using Apex version 3.2.0.00.27. I am trying to delete an existing application (App_ID 116). I am continually getting ORA-01000: maximum open cursors exceeded.
    Prior to deleting this application, I attempted to, instead, import (that is, replace) this app with a previously saved Apex app (APP_ID 116). This previously saved app is also at the same version. I get the same error. At that point, I figured that I would delete the app and then import my previously saved app, only to get the same error.
    I then attempted to import the previously saved app as a new APP_ID (256). This time, the app imported without error.
    Does anyone know what is going on? Could it be that my existing app 116 is "corrupted" (whatever that means)? Why can't I delete or import over my existing app 116?
    Any help would be appreciated.
    Thank you.
    Elie

    Post Author: amr_foci
    CA Forum: Information OnDemand
    its a database related Error and it can be fixed
    please check this link
    http://publib.boulder.ibm.com/infocenter/wasinfo/v4r0/index.jsp?topic=/com.ibm.support.was.doc/html/EJB_Container/1040875.html
    good luck
    Amr

  • Application error- can't open itune

    Every time when I open itunes, it always shows as follows,
    iTunes.exe-Application Error:
    The exception Privileged instruction, (0xc0000096) occurred in the application at l0cation 0x013ec36a.
    Click on OK to terminate the program
    Click on CANCEL to debug the program
    Please help.

    I do not know the answer to this, but if you are willing to to do some troubleshooting:
    Which version of windows are you using?
    XP vista or 7, 64 bit or 32 bit.
    Do you have Quicktime? If so does Quicktime launch?
    Did you change anything on your computer just before this problem started?
    Please look in the Event viewer for a helpful error message.
    To open the event viewer:
    Control Panel>>Administrative Tools>>Event Viewer
    Or type Event Viewer into the search box.
    Then select Windows Logs>>Application
    Open the Event viewer immediately after iTunes crashes.
    The error message should be at or near the top.
    Double click on it to open more information and press copy.
    Paste the result into your post.
    You are looking for a message starting something like this:
    Problem Event Name: APPCRASH
    Application Name: iTunes.exe
    Application Version: 10.2.1.1
    Application Timestamp: 4d756476
    Fault Module Name: iTunes.dll

  • Application error and crash in cs4

    All- I just reinstalled cs4 photoshop and I keep getting an application error that the memeory can not be read.  Can anyone tell me why? I was having this same problem on my old computer, I have just gotten a new one, and have reinstalled but still get the error.
    thansk in advance!
    Missy

    Does your computer meet the system requirements for CS4?
    If not, that might be the problem.
    Also, when you reinstalled CS4, did you restore anything from your old installation?
    If no, I would advice you to try and make a complete uninstall, delete all folders after uninstalling, then try to make a new and clean installation.
    If the problem still exists, can you please provide the full error message?
    Another thing is if you have a lot of programs and stuff running, that could be why you get this error message, try to restart your PC, then open up only CS4 after the restart, see if you get the error when only running CS4.

  • Problem after raising application error

    Hi,
    I would really appreciate any insight on this issue. Thanks.
    I have a page that has fields that submit when entered. There is no problem there.
    I have a button that when clicked runs a process and if certain condition happens to occur then it calls the raise_application_error.
    I click OK and it takes me back to the previous page.
    Problem doesn't go away if I fix the problem and press enter.
    What do I have to do to reset to the submit button (which by the way is hidden) and not the print button which also submits the page.
    Thanks in advance

    Thanks Scott
    I had a few things happening. But I figure out how to prevent it by getting some correct values to begin with.
    The issue about the button and getting the error over and over is something related to a value on a field that is not reset. I'm not using collections.
    Solve this issue I'm just telling the customer to do a refresh and that gets rid of the negative values that raises the error.
    Thanks

  • I have just launched icloud on my windows 7 laptop, and stupidly added my outlook email contacts - ie addresses to my icloud contacts. So, there are now 1000's of contacts.  How do I delete these and preserve the original telephone and address contacts,?

    I have just launched icloud on my windows 7 laptop, and stupidly followed the instructions and added my outlook email contacts which come up as email addresses to my whole icloud contacts. So, there are now 1000's of contacts which have now appeared on my iphone.
    How do I delete these email addresses and preserve the original straightforward names with telephone and address contacts?  I am not very technical and am frustrated in my attempts to rectify the situation.
    Thanks

    For your contacts go to settings on your phone - mail contacts and calendars - scroll down to contacts and change display order to the one you want ( you can also change sort order, but ususally people prefer last name first and see if that is what you have).
    For your yahoo emails go on your computer open outlook
    In Outlook 2010, choose File > Accounts.
    Click account settings and confirm the command by clicking "Add and remove accounts or change existing connection settings."
    Select account and click "Change."
    Click "Advanced."
    Click "More Settings."
    Click the "Advanced" tab.
    Enter "7" in the box to the right of "Remove from server after."
    Click OK.
    Close Account Settings.
    If you have outlook 2007
    In Outlook 2007, choose Tools > Account Settings.
    Click the account you wish to edit and then click Change.
    Click the "More Settings" button.
    Select the Advanced tab located across the top of the window.
    Select the "Leave a copy of messages on the server" option.
    Select the "Remove from server after" option.
    Enter 7 in the box to the right of "Remove from server after."
    Click OK.
    Close Account Settings.

Maybe you are looking for

  • Network connection sometines doesn't work (WPA or WEP)

    Hi, My Macbook is sometimes refusing to connect to my wireless network. When the problem occurs, my network is available and listed among all the other available networks. According to tools such as iStumbler, network strength is very good. Basically

  • How do I transfer files from a time machine hard drive to a new MacMini?

    My MacBook Pro running 10.5 is slowly dieing. I want to transfer files, photo libraries, iTunes to our new MacMini runing 10.8. When I connect a hard drive to my MacBook Pro, the screen freezes. I think I need to use the Time Machine copy  from the M

  • IMovie 6.0.3 won't render Ken burns effects or Themes

    I'm working in iMovie 6.0.3. Whenever I try to apply a Ken Burns effect or a theme, the red "render" bar completes, but then I just end up with a frames of empty black the same length as whatever I had tried to put there. I tried deleting the com.app

  • My iMac stops responding... its' literally freezes....

    and can't move a thing... the screen is still on. no kernel panic or anything... even checked the diagnostic logs... shows nothing... last one I had was 3 weeks ago... but I recently experienced this a couple of times. some sites recommend check memo

  • Where is the official reference to know how many MBs of RAM does iPad have?

    Hi guys, I have read discussion here and get to know that iPad has 256 MBs of RAM, but the discussion is user-to-user discussion. I want to know that is there any official reference to point that how may RAM in all types of iPad machines? Thank you v