How to Correctly Trap PL/SQL Errors for APEX
This is probably a simple fix but, I have been at it for a while and can't seem to find the magic combination.
I have a page process that calls back end PL/SQL. I have a page item that is populated by said PL/SQL procedure, P35_PROCESSING_MSG. As you know the Process allows me to specify a message for Success and another for Failure. My desire is that, if there is a back end failure, the error will display in the dialog area, using the built-in "Process Error Message" functionality. Instead, after execution, the page item still has its default value and the following, ugly, error displays in the tabular report region.
report error:
ORA-20001: Error fetching column value: ORA-01403: no data found
ORA-06510: PL/SQL: unhandled user-defined exceptionI just don't get why it displays here instead of in the usual failure area. Moreover, I don't understand why the error is "*+unhandled+* user-defined exception" when, as you will see, I have handled it.
I have a page process to perfom custom MRD for a tabular form. (I don't think this is really germane to the more generic issue but, I bring it up as an explanaintion for the following code sample). I am diliberately causing a DIVIDE BY ZERO error to test the error handling form the back end.
PROCEDURE PROCESS_MARGIN_CALL_DELETES( as_StatusMsg OUT VARCHAR2 )
IS
lb_InnerErrorOccured BOOLEAN := FALSE;
ln_DeleteTargetCnt NUMBER := 0;
ln_DeleteTargetRow NUMBER := 0;
BEGIN
ln_DeleteTargetCnt := apex_application.g_f01.COUNT;
FOR ln_DeleteTargetIndx IN 1..ln_DeleteTargetCnt
LOOP
ln_DeleteTargetRow := apex_application.g_f01(ln_DeleteTargetIndx);
BEGIN
If ( apex_application.g_f14.EXISTS(ln_DeleteTargetRow) ) Then
select 1/0 into ln_DeleteTargetCnt from dual;
DELETE FROM RISKDM2.INTRADAY_ECS_RSKALYST_MRGCALL
WHERE RISK_MARGCALL_ID = apex_application.g_f14(ln_DeleteTargetRow);
End If;
EXCEPTION
WHEN OTHERS THEN
as_StatusMsg := as_StatusMsg || SQLERRM;
lb_InnerErrorOccured := TRUE;
END;
END LOOP;
If ( lb_InnerErrorOccured = TRUE ) Then
RAISE INNER_EXCEPTION;
Else
as_StatusMsg := 'Successfully Processed';
End If;
EXCEPTION
WHEN INNER_EXCEPTION THEN
RAISE_APPLICATION_ERROR( -20001, as_StatusMsg );
WHEN OTHERS THEN
as_StatusMsg := as_StatusMsg || SQLERRM;
RAISE_APPLICATION_ERROR( -20000, as_StatusMsg );
END; The associated code in APEX is short and sweet:
BEGIN
MBRDATA.MEMBER_MGR.PROCESS_MARGIN_CALL_DELETES( :P35_PROCESSING_MSG );
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR( -20002, :P35_PROCESSING_MSG );
END;What I am missing?
-Joe
Joe Upshaw wrote:
This is probably a simple fix but, I have been at it for a while and can't seem to find the magic combination.
I have a page process that calls back end PL/SQL. I have a page item that is populated by said PL/SQL procedure, P35_PROCESSING_MSG. As you know the Process allows me to specify a message for Success and another for Failure. My desire is that, if there is a back end failure, the error will display in the dialog area, using the built-in "Process Error Message" functionality. Instead, after execution, the page item still has its default value and the following, ugly, error displays in the tabular report region.
report error:
ORA-20001: Error fetching column value: ORA-01403: no data found
ORA-06510: PL/SQL: unhandled user-defined exceptionI just don't get why it displays here instead of in the usual failure area. Moreover, I don't understand why the error is "*+unhandled+* user-defined exception" when, as you will see, I have handled it.<Jedi>These are not the errors you are looking for.</Jedi>
Anything included under a "report error" during page rendering is not displaying errors associated with a page process, but with the rendering of that report region, in this case clearly:
ORA-20001: Error fetching column value: ORA-01403: no data foundThe ORA-06510 user-defined exception error relates to this (ORA-20001 being a user-defined error), but it is coming from the APEX framework rather than your code. Often these prove to be untraceable, unrecoverable problems caused by corruption of report metadata, only "fixable" by dropping and recreating the region.
This may or may not be related to the setting of the page item "by said PL/SQL procedure", but the exceptions reported in the region are not being raised by the procedure.
What does the debug trace show to be going on?
Edited by: fac586 on 15-Aug-2012 08:35
Added "...reported in the region..." for clarity
Similar Messages
-
How to start listener in sql developer for remote debug
how to start listener in sql developer for remote debug ? Since the new version 1.1.0.23 is different with the old version for remote debug, I don't know how to start the listener on the new version for remote debug.
even follow the user guide below and not work . Experts on sql developer please help me with this.
Remote Debugging
To debug a procedure or function for a connection where the database is on a different host than the one on which you are
running SQL Developer, you can perform remote debugging.
Remote debugging involves many of the steps as for local debugging; however, do the
following before you start the remote debugging: Use an Oracle client such as SQL*Plus to issue the debugger connection command. Whatever
client you use, make sure that the session which issues the debugger connection commands is the same session which executes your PL/SQL
program containing the breakpoints.
For example, if the name of the remote system is remote1, use the following SQL*Plus command to open a
TCP/IP connection to that system and the port for the JDWP session:
EXEC DBMS_DEBUG_JDWP.CONNECT_TCP('remote1', '4000'); The first parameter
is the IP address or host name of the remote system, and the second parameter is the port number on that remote system on which the debugger
is listening.
Right-click the connection for the remote database, select Remote Debug, and complete the information in the Debugger - Attach
to JPDA dialog box. Then, follow the steps that you would for local debugging (for example, see Debugging a PL/SQL Procedure).
Debugger - Attach to JPDA This dialog box is displayed when you right-click a database connection name and select Remote Debug.
Use this
dialog box if you are using the Sun Microsystem's Java Platform Debugger Architecture (JPDA) and you would like the debugger to listen so
that a debuggee can attach to the debugger.
For more information about remote debugging, see Remote Debugging.
Host: Name or IP address of
the remote host on which SQL Developer should listen for the database to connect.
Port: Listening port number on the remote host. You can
choose any valid port number that is not in use by another process.
Timeout: The number of seconds that SQL Developer will wait for the
remote database to make a debugging connection. Don't Show Dialog Box Before Connecting: If this option is checked, this dialog box will not
be displayed before future connections for remote debuggingYou're not the only one:
Not able to start remote debug listener
Re: remote debug question at version 1.1.0.23 64 -
How to capture the exact SQL exception for failure to connect to database
Hi, i would like to capture the exact exception for failure to connect to a Oracle 9i database (via JDBC). I learnt that there is specific code or exception that can be captured, so that a more proper error message can be thrown out like "Failure to connect to database" can be displayed. Anyone know how to go about doing it? thanks
That depends on your database vendor, I believe. (Unless there's a SQL standard for states and codes that I'm unaware of.)
Personally, I wouldn't worry about "catching" a particular code. (You've already caught the exception - that's the best you can do.) I'd report the error code and state and just look up what it means when I got one.
Hopefully you won't be catching exceptions. They're supposed to be rare. - MOD -
How to correct or report location errors introduced with iOS 4 vs. iOS 3.x?
When I use location services (via any application) on my iPod touch (1st gen - iOS 3.1), including Find-my-iPhone, my touch's location is precisely located. I have even reported both my wireless routers to Skyhook to assure this accuracy at home.
My iPad, however (via any application, including Find-my-iPhone), has a location error of about 250 yards to the south south east. All of my neighbors with new WiFi-only iPods and iPads think location services is crappy, because it doesn't locate them in their home. Those with 3G support don't generally have the problem.
I've tried to find out where I can report the precise coordinates of my personal hardware (as I did for Skyhook) so Wi-Fi location is improved AND notify the proper organization that an entire swath of East Texas has been scanned with a large location bias, turning data into garbage. Anybody know who to talk to?Basically, Apple need to inform people how to correct their router info that is contained in their faulty "Locations Service Database" - now, in theory, Apple could collect this information from a user by means of a simple web based form on their support site that asked for the MAC address of the router and either latitude/longitude info or even the users' post code (Zip code). However, in practice this might be harder to do owing to security concerns...
I have had problems with the WiFi provided location service on BOTH my iPad and iMac for at least 2 weeks now. It shows me as being in central London when I am in fact in Central Scotland - very annoying!
What is just as annoying is that there is no info from Apple to even acknowledge that this problem exists...
I have raised this issue with Apple Support via their iPad feedback page - but no response yet. -
SQL error for searches within Arch forums
Hi guys,
Since last night, when ever I try to run a search, whether it be a pre-defined search like New Posts or last 12h, or a keyword search within the search page, I get an error:
Could not delete old search id sessions
DEBUG MODE
SQL Error : 1016 Can't open file: 'phpbb_search_results.MYI' (errno: 145)
DELETE FROM phpbb_search_results WHERE session_id NOT IN ('b8a882a76bd524ca2cae00763907813a', 'ff63868080729e0ee81c83f1e2b08fac', '153ae6e2b7dfa3b1acab764caf6251a9', '61230f3df774fc9e05bbd91b9de8ab6a', 'ebea35cab271f97e47a0edeb867f350b', '852bae4b6e661b50c6e656eacab5204f', '874a6ac043dfb52bd2162d92f3700b28',
... (goes on for ages) ...
'eb520a66784db4079cf64fbf16316d65', '9f2f2ebe525f98222e32c1cefffd7ea1')
Line : 663
File : search.php
This is rather annoying as I can't look for the latest posts easily.There's already a discussion about it here:
http://bbs.archlinux.org/viewtopic.php?t=17004
Locking to keep continuity. -
How to configure traps when using snmpv3 for Airwave and controller communication
Requirement:
Airwave monitoring or managing controllers, using SNMPv3 for communication.
Solution:
Usage of SNMP v3 for communication over SNMP V2c is increasing rapidly for its enhanced security. Like wise, SNMP v3 informs are also more secured compare to SNMP v2c traps.
SNMP v3 informs work differently, when compared to SNMP v2c traps. As, informs would need a received receipt from the trap receiver. Therefore it requires more configuration from Airwave side as well.
Configuration:
We need to configure the SNMP v3 inform user on Airwave, under device setup --> communication as shown below:
We need to use the same user name to configure on the controller as well, as shown below:
Controller GUI > Configuration > under management > SNMP > Trap recievers:
Verification
After the configuration, we could see the traps(Informs) showing on the Airwave GUI, System --> Syslogs & Traps, as shown below:
We could also see in the packet capture taken from Airwave, that the controller is sending the Traps and Airwave is Acknowledging them as shown below:
In the above example, .116 is the Airwave IP and .231 is the controller IP.My first question is how to create Sync-Async bridge in XI without using BPM.
Just make a search on SDN, there is blog which mentiones how to do Sync_Async bridge without BPM (for JMS)
"how to route this Interface mapping in Integration directory as in this case there is no backend call....its just the Java
mapping inside an Interface mapping"
Include the Interface mapping in the appropriate Interface Determination in ID for a particular set of source and target.
and third I m trying to call an IDOC which is populated with the response of the Java mapping....but how to route it in
Integration Directory ??
same as mentioned for Q2....in Interface Determination....if it is a Sync call then the Request & Response Mapping will be in same Interface Mapping and then in same Interface Determination......it is the normal way.....I hope that i have not missed/ overlooked something from your queries!
Regards,
Abhishek. -
How to correctly write an MDX expression for a set
Hello,
i've got 2 dimension hierarchies:
1) [Hierarchy1].[CityOfBirth]
2) [Hierarchy2].[CityOfResidence]
Both these hierarchies contain same members - cities
How do I write an MDX expression for a set containing all possible combinations of both dimensions ([Hierarchy1].[CityOfBirth].Member, [Hierarchy2].[CityOfResidence].Member)
but excluding those tuples where [Hierarchy1].[CityOfBirth].Member = [Hierarchy2].[CityOfResidence].Member.
I.e. there shouldn't be tuples like (New York, New York) or (Chicago, Chicago) in the set.Hi,
depending on the structure of your hierarchies, someting like the following should work:
SELECT
{} ON 0
,Filter
[Hierarchy1].[CityOfBirth]
[[Hierarchy2].[CityOfResidence]
[Hierarchy1].CurrentMember.Name
<>
[[Hierarchy2].CurrentMember.Name
) ON 1
FROM [Your Cube];
The way the cities are expressed should of course be the same: "NY" is different from "New York"
Something about the same in the adventure works cube for testing. the two geography hierarchies are here from a different dimension:
SELECT
{} ON 0
,Filter
[Customer].[Customer Geography].[Country]
[Geography].[Geography].[Country]
[Customer].[Customer Geography].CurrentMember.Name
<>
[Geography].[Geography].CurrentMember.Name
) ON 1
FROM [Adventure Works];
Philip, -
How do I correct a Windows Vista error for HP Officejet 6500 E709n wireless?
I continue to get a Windows Vista error when trying to install the printer software ...now it does print, but only the bottom half of a page..???
Dave, I would recommend completely uninstalling the printer from Programs and Features (after unplugging the USB cord if you are using one), and removing the printer from both Device Manager and Devices and Printer.
We are going to reinstall the printer from one of the downloads that HP makes available, but first I will have to know if your printer is the 6500A or the 6500. Also is your Win Vista machine running 64bit software or 32bit software?
If you can give me a complete product name and the information on your system, I will link you to the appropriate download.
Let me know! -
How to write the pl/sql code for this scenario
Hi,
Here is the data in a Table with below colums
id firstname lastname code
1 scott higgins 001
2 Mike Ferrari 001
3 Tom scottsdale 002
4 Nick pasquale 003
1 scott higgins 004
I want to trap the following exceptions into an error table using pl/sql
1. same person having multiple code
example
id first last Code
1 scott higgins 001
1 scott higgins 004
2. Multiple persons having same code
id first last Code
1 scott higgins 001
2 Mike Ferrari 001
Could you please help me how to capture the exceptions above using pl/sql
and what will be the structure of error table. it should capture eff date & end dateor using analytic functions like this:
select id, fname, lname, code from (
with t as(
select 1 id, 'scott' fname, 'higgins' lname, 001 code from dual
union all
select 2 id,'Mike ' fname, 'Ferrari' lname, 001 code from dual
union all
select 3 id,'Tom' fname, 'scottsdale' lname, 002 code from dual
union all
select 4 id,'Nick' fname, 'pasquale' lname, 003 code from dual
union all
select 5 id,'scott' fname, 'higgins' lname, 004 code from dual
select t.*, count(*) over (partition by fname) row_count from t)
where row_count > 1;
select id, fname, lname, code from (
with t as(
select 1 id, 'scott' fname, 'higgins' lname, 001 code from dual
union all
select 2 id,'Mike ' fname, 'Ferrari' lname, 001 code from dual
union all
select 3 id,'Tom' fname, 'scottsdale' lname, 002 code from dual
union all
select 4 id,'Nick' fname, 'pasquale' lname, 003 code from dual
union all
select 5 id,'scott' fname, 'higgins' lname, 004 code from dual
select t.*, count(*) over (partition by code) row_count from t)
where row_count > 1; -
How can i import java.sql package for midlet development
I am trying to write a midlet app using Wireless Toolkit 2.5.2. I would like to connect my application to JavaDB in embedded mode. But when I write "import java.sql.*;", I get an error "package java.sql does not exist
". I would like to know how can i include this package. please help.FBL wrote:
Sorry to jump in, but isn't there limited jdbc using unconventional methods?
[http://developers.sun.com/mobility/configurations/articles/cdc/jdbc/|http://developers.sun.com/mobility/configurations/articles/cdc/jdbc/]
If so, I feel this may better answer the OPs question.
-TresAbove article refers to CDC - it is useless in CLDC midlets -
How to throw or catch sql exception for executeReader sql adapter
Wcf sql adapter was created and executeReader was used.
When an invalid sql statement was constructed and send it to wcf sql adapter, it will hanging there, and no response. No exception was catched even though send chape was inside a catch block. How can I catch this kind of exception
or throw this exception ? I need to give client an exception resposne.
thanks
GaryI used scope with exception handle which has Exception object type: "System.SystemException".
I guess this type "System.SystemException" can catch any exception, including sql exception. Maybe I am wrong. I got error from window event:
A message sent to adapter "WCF-Custom" on send port "WcfSendPort_SqlAdapterBinding_DalCore_Custom" with URI "mssql://shig-quad-2k3e1//DataSourceOne?" is suspended.
Error details: System.Data.SqlClient.SqlException: Incorrect syntax near '='.
Server stack trace:
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
MessageId: {B24EF5B8-298A-4D4F-AA98-5E639361A7DB}
InstanceID: {F8924129-265B-4652-B20E-8D25F8F20A51}
If "System.SystemException" can't catch all exception, which type can catch all exception ? I want to catch all exception in this catch block.
thanks
Gary -
IPad sql error for a complete dummy
i have been using a website for weeks and until today there has been no problem. I'm now getting an error message and have no idea why. Have tried completely restoring ipad but to no avail. I'm not technically minded in sql code and scripts etc but am able to use ipad and follow any instructions to fix this.
error message says "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)"
please helpThat is a problem on the website and not your iPad. Can confirm by doing the same transaction on a computer-based browser. Will need to contact whatever support the website has and wait till they fix it over there.
IF it works on a computer browser (such as Firefox or Internet Explorer), then maybe they changed something and made the site unworkable for the iPad's Safari browser. Can try downloading and using a different browser on the iPad, such as Chrome, Opera, Apollo, Mercury, all for free.
The iPad does not have or run a local MySQL server. -
How to correct Mail 5.3 errors in OS 10.7.5 update on Mac Pro
Since downloading update to OS10.7.5 from Software Update in December, Mail (5.3) cannot send out and all SMTP servers are listed as "Offline". What has caused this and what's the fix??
I have 3 accounts in Mail, from 3 different mail clients with 3 different SMTP outgoing servers. I cannot send any outgoin mail and one one account cannot even open any INBOX mail listed prior to 29th December when I did the update of OS10.7.5. On the other two accounts I can open previous mail.
Have checked the settings of all 3 accounts and seem ok. I have Entourage on the same machine and there is no problem using the same 3 accounts on MS Office Entourage. So seems that it is Mail that is affected. But why and what's the fix?
I have tried and downloading installing the latest update as Mac OS10.7.5 Combo, but it made no difference? I am using a mid-2011 MacPro 2.3 Ghz Intel Core i5.
Grateful for any suggestions, advice etc.
I have put this problem up last week but have been struck by the number of similar Mail problems reported and the curious shortage of replies, let alone suggestions for fixes. Is there something about Mail problems that are so different form the general range of OS/software problems in Macs???Did verify disk permission, repair disk permissions
Steffi, since you can not boot I will assume you did this from your install DVD under Disk Utility. Go back again and this time run the Disk Repair, if there are any error (red) message run the Repair again. Then check the SMART Status at the bottom of the window, it should say "Verified". Quit DU, reboot, then download the 10.5.3 Combo Update from the Apple site and try it again this time without any peripheral attached.
http://www.apple.com/downloads/macosx/apple/macosx_updates/macosx1053comboupdate .html
JG -
How to always hide the SQL statements for users when they run User Queries?
Hi,
from the IT dept. position, I don't want users to see and be so curious about the SQL commands.
How can I always hide the textbox of Display Query Structure?
thanks.Hi,
Unfortunately system design has short of this function. If users are allowed to run those queries, you can not hide the query structure.
You may post a DRQ here: /community [original link is broken]
Thanks,
Gordon -
How can I resolve convert first error for sq02/sq03 in SAP 4.0
Hello SAP Gurus,
When I use transactions sq02/sq03 for creating queries in SAP 4.0, i get the following message.
Convert first
Message no. AQ 898
Diagnosis
Before you work with queries, functional areas or user groups in this
work area, you must convert the objects.
Procedure
Get your system administrator to convert the objects. The ABAP Query
Release Information for Release 4.0A describes how to convert these
objects.
Please guide me on resolving this issue.
Thanks and Regards,
Sharmin ShivaniDear Sharmin;
Go to SE38 and run the program "RSAQUM40", then click on set release flag option then click execute.
after that go back to SQ02, SQ03 and create your infoset and it should work.
You can read also SAP Note 92124 for more information.
Best Regards
~Amal Aloun
Maybe you are looking for
-
Read-only radio button or checkboxes save as null
Hi, I have a form with some fields that are editable by 1 group of users and read-only for another group in certain conditions. Before the header there is a fetch process to retrieve values from tables. So most fields (read-only & editable) are popul
-
Prompting to save as new document when trying to save over existing document
I'm hoping someone here can help me. I'm having a problem with saving changes to PDFs. If, for example, I sign or insert pages into a PDF and attempt to save those changes (mind you these are documents which I have already created and saved locally),
-
Lumia 625 GDR3 Not getting Lumia Black
Hi, I updated my Lumia 625 3 weeks ago to GDR3 and it was supposed to update to Lumia black as well. However i didnt get the black update. the extras+info still shows amber however i received all the GDR3 options like screen orientation lock and clos
-
OMG, after last AIR update before current ALL my AIR apps will not work, HELP!
I have 5 or 6 AIR based apps after I did an update last month, none of them will work. I just re-installed and updated AIR again today and re-installed all the apps multiple times and when I go to one it trys to open the last I installed for every ap
-
Hi, I am trying to understand the new features of oracle 11gR2. I have a oracle 11gR2 installation and trying out the NDM TUTORIAL. I am facing the following problems: I tried to download the sample data (.dmp)for San Francisco from NAVTEQ website,Ho