Misleading error messages in Apex

Hello all,
I am looking at default values. I simply want to go to the database, call a functin and set the value using PL/SQL Function Body. Here is what happens:
Check in SQL*Plus first ...
blast:Blast-Bld@ORCL> delete blast_log;
6 rows deleted.
blast:Blast-Bld@ORCL> commit;
Commit complete.
blast:Blast-Bld@ORCL> select W_REG.GET_MONTHLY_FEE(1000) from dual;
W_REG.GET_MONTHLY_FEE(1000)
39.95
1 row selected.
blast:Blast-Bld@ORCL> @log
MDL UNT Typ MSG
W_REG GET_MONTHLY_FEE I Begin
REG IS_VALID I Begin
REG IS_VALID D Check Reg ID: 1000 Found 1 row(s). (1 = True else False).
REG IS_VALID I End
W_REG GET_MONTHLY_FEE D Return Reg Fee: 39.95
W_REG GET_MONTHLY_FEE I End
6 rows selected.
blast:Blast-Bld@ORCL> delete blast_log;
6 rows deleted.
blast:Blast-Bld@ORCL>
Now run Apex:
Get the following message:
ORA-01403: no data found
ERR-9131 Error in PLSQL function body for item default code, item=P1000_MONTHLY_FEE
Return to application.
Look at item P1000_MONTHLY_FEE ...
Default = RETURN W_REG.GET_MONTHLY_FEE(1000);
Type = PL/SQL Function Body.
Look in database logging table:
MDL UNT Typ MSG
CODE GET_CODE_SET_ID I Begin
CODE GET_CODE_SET_ID D Get Code Set ID for PersSalut
CODE GET_CODE_SET_ID I End
Function was not called!!!!
To be absolutely sure, call again from SQL*Plus with cut and paste ....
blast:Blast-Bld@ORCL> select W_REG.GET_MONTHLY_FEE(1000) from dual;
W_REG.GET_MONTHLY_FEE(1000)
39.95
1 row selected.
blast:Blast-Bld@ORCL> @log
MDL UNT Typ MSG
CODE GET_CODE_SET_ID I Begin
CODE GET_CODE_SET_ID D Get Code Set ID for PersSalut
CODE GET_CODE_SET_ID I End
W_REG GET_MONTHLY_FEE I Begin
REG IS_VALID I Begin
REG IS_VALID D Check Reg ID: 1000 Found 1 row(s). (1 = True else False).
REG IS_VALID I End
W_REG GET_MONTHLY_FEE D Retunr Reg Fee: 39.95
W_REG GET_MONTHLY_FEE I End
9 rows selected.
blast:Blast-Bld@ORCL>
Looks Fine.
Thus the message returned from Apex is misleading to say the leaset.
Any ideas?

Thanks guys,
(Note that LG is a logging package)
Note also that the reg id is checked first (IS_VALID) to avoid NDF exception.
But what prompted me to make the post is not so much the function, but rather that the message from apex is not very helpful .... unless I'm missing something.
thanks again.
here is the function:
FUNCTION GET_MONTHLY_FEE (p_reg_id REGISTRATIONS.REG_ID%TYPE)
RETURN REGISTRATIONS.MONTHLY_FEE%TYPE IS
l_monthly_fee REGISTRATIONS.MONTHLY_FEE%TYPE;
BEGIN
LG.PUSH('W_REG', 'GET_MONTHLY_FEE');
if REG.IS_VALID(p_reg_id) then
select nvl(monthly_fee,0)
into l_monthly_fee
from registrations
where REG_ID = p_reg_id;
else
LG.POP_ERR('Invalid Registration ID: '||p_reg_id);
RETURN SYS_CODE.C_INT_NOT_DEFINED;
end if;
LG.W ('D', 'Return Reg Fee: '||l_monthly_fee);
LG.POP;
RETURN l_monthly_fee;
END GET_MONTHLY_FEE;

Similar Messages

  • Show Custom Error Message in Apex

    Hi,
    I have created a Master-Detail form on Dept and Emp tables. In Dept table, I have deptsal column which is updated by a trigger on EMP table.
    DEPT table has following trigger:
    create or replace trigger "TRG_DEP_SAL"
    BEFORE UPDATE on "DEPT"
    FOR EACH ROW
    BEGIN
    IF :NEW.deptsal > 100 THEN
    RAISE_APPLICATION_ERROR(-20001,'Dept Salary too high!');
    END IF;
    END;
    So, when I enter salary on Apex Form which increases the limit of deptsal e.g. 100, it gives the following error message:
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: Dept Salary too high! ORA-06512: at "ZAHIDKHANUK.TRG_DEP_SAL", line 4 ORA-04088: error during execution of trigger 'ZAHIDKHANUK.TRG_DEP_SAL' ORA-06512: at "ZAHIDKHANUK.BIUD_EMP", line 11 ORA-04088: error during execution of trigger 'ZAHIDKHANUK.BIUD_EMP', update "ZAHIDKHANUK"."EMP" set "EMPNO" = :b1, "DEPTNO" = :b2, "ENAME" = :b3, "JOB" = :b4, "MGR" = :b5, "HIREDATE" = :b6, "SAL" = :b7, "COMM" = :b8, "ID" = :b9 where "EMPNO" = :p_pk_col
    Error Unable to process update.
    OK
    How can I display my own message?
    Thanks,
    Zahid

    Hi,
    Yes, you can do that. You would need to create a page validation that loops through the records in the tabular form, checks the values entered and then returns an error message.
    Create a new validation. Set it to a Page level validation, select PL/SQL and then Function returning error text, then give it a name. The PL/SQL will be something like:
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT
    LOOP
      IF TO_NUMBER(APEX_APPLICATION.G_F04(i)) > 100 THEN
       RETURN 'Item ' || TO_CHAR(i) || ' - DEPTSAL must not be greater than 100';
      END IF;
    END LOOP;
    RETURN NULL;
    END;This will loop through the records in column 4 and check the amount. If it is greater than 100, an error message is generated displaying the row with the error. This will stop the process on the first error. If there are no errors NULL is returned which indicates that the validation test has passed.
    You should replace G_F04 with the correct column for your page - do a View Source on the loaded page and check for the "name" attribute for the column. G_F04 is for "f04", G_F05 is for "f05" etc.
    Andy

  • How to display Error Message in APEX from Database Stored Procedure

    Hello,
    Using APEX version 3.2
    DB version 9.2.0.8.0
    Internet Explorer version 6
    I have an After Submit Page Process that calls a stored procedure. In the exception section I'm using dbms_output.putline to display an error message, but the error message is not displayed in APEX. How can I have the error message generated from the stored procedure display in APEX?
    Thanks so much.

    Hi Apex_Noob,
    I created On Load - Before Header process that uses apex_application.g_notification := :P3_ROLE;I'm sorry but I'm not sure what you mean by "instead of using dbms_output.putline use :P1_ITEM"
    I have the following code in my stored procedure
    EXCEPTION
         WHEN OTHERS THEN
         dbms_output.put_line('Role does not exist');Thanks.

  • Table Creation halted by misleading error message

    When creating a table, the action was not allowed with error 01950 - no priviledges on tablespace NAME.
    The JDeveloper GUI front end provides many "priviledges",
    none of which corrected the situation.
    It was not until I went to orafaq.com and did a search
    did it show me that the error was in the Quota.
    It would improve the product to add a new error message
    that reads: "No Quota on tablespace NAME" so users are not misled.

    Please post technical questions at
    General Database Discussions
    Regards,
    Anupama

  • Misleading Error message when saving Site

    Need Help, Dreamweaver CS5 reports that the root folder for the site I am saving in going to save it in another folder. I have checked all folder links in the site configuration dialogs but none point to the root folder displayed in the error message. This seems to be a configuration file error. I have multiple sites and it seems to happen on all of the site when I save any site configuration.

    My local sites are setup as follows:
    Using two local webservers:
    Zend
    Coldfusion
    No confilcts on webservers, I only run one webserver at a time.
    localhost:8500 is Coldfusion
    localhost:8080 is Zend
    Have a testing directory with the same name as the local directory in the proper hdocs or www for the proper language.
    All have remote sites and are active and functional.
    Local Sites Respository (Each Site is a self contained website, Some static, Some PHP, Some Coldfusion)
    For Example:
    C:\Users\SEOMarketing\My Web Sites\Newcar
       No Local Testing Server
    C:\Users\SEOMarketing\My Web Sites\Ventura-Stone
      No Local Testing Server
    C:\Users\SEOMarketing\My Web Sites\NewDraperySite
      Local Testing Server C:/Program Files (x86)/Zend/Apache2/htdocs/NewDraperySite
    C:\Users\SEOMarketing\My Web Sites\FBG
      Local Testing Server C:/Program Files (x86)/Zend/Apache2/htdocs/FBG
    C:\Users\SEOMarketing\My Web Sites\learningcoldfusion
      Local Testing Server: C:/ColdFusion9/wwwroot/learningcoldfusion

  • MARS GC, misleading error message

    Adding of local controller failed with this error message:
    The local controller you intended to add is , hence cannot be added based on license key permissions.
    The real problem is that GC is not reaching LC's because ACL on the path between.
    Would be nice to have that kind of message (for example: LC not responding/reachable)!

    The error message will occur only if the line card is faulty. Replacing line card will resolve this issue.

  • XSQL arbitrary adhoc query - misleading error

    Newbie question: How can I allow arbitrary adhoc queries without getting misleading errors? (I am aware this can be a security hazard)
    Trying
    CREATE table test5(tla varchar2(3), description varchar2(80), primary key (tla))
    on the following .xsql page
    <?xml version="1.0"?>
    <xsql:query connection="demo" xmlns:xsql="urn:oracle-xsql"
    null-indicator="yes"
    allow-client-style="yes">
    {@query}
    </xsql:query>
    yields a
    <?xml version="1.0" ?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: ORA-01009: missing mandatory parameter</ERROR>
    Note that despite the error the test5 database is actually created and usable in SQLPlus.
    Retrying the same xsql query a little later confirms this and yields
    <?xml version="1.0" ?>
    - <xsql-error code="955" action="xsql:query">
    <statement>create table test5(tla varchar2(3), description varchar2(80), primary key (tla))</statement>
    <message>ORA-00955: name is already used by an existing object</message>
    </xsql-error>
    Any ideas on how to avoid the misleading error message?
    Otherwise XSQL works nicely.
    Thanks.
    null

    <xsql:query> expects a query to be done.
    Use <xsql:dml> if you want other kinds of DML/DDL statements to be done.

  • "Printer cartridges not installed correctly" error message

    HP Tech Support and HP Envy Users, Still getting the "Printer cartridges not installed correctly" error message for no good reason and it's July 2015! HP should have fixed this problem a long time ago based on the date of the posts from users. And/or corrected the misleading error message, as the users did install them correctly. I didn't get an installation error message when I installed my cartridges and I have been able to print successfully on this current set of cartridges. My error message appeared out of the blue. I've done all the troubleshooting steps except replace BOTH cartridges. I will do that. If the error message goes away once I've replaced one or both cartridges, HP should have long provided an update that says, "replace ink cartridges" and not the misleading one of not being installed correctly. If that doesn't clear up the problem, I will call HP as it's still under warranty. Hope I didn't get one of the "lemons" that require servicing.

    Hello @jimboware and welcome to the HP Forums!
    As far as I'm aware, there is no Windows 6, did you perhaps mean Windows 7? This What's My OS link will help if you'd like
    When you're starting the install, do you plug in the USB cable before the software asks for it?
    Let me know that information and we'll go from there!
    Please click “Accept as Solution ” if you feel my post resolved your issue, as it will help others find the solution faster
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    **MissTeriLynn**
    I work on behalf of HP

  • Adobe Digital Edition keeps showing error message when i download my ebook. Pleease help?

    i have restarted my pc closed and opened the program, opened another internet page to check if its connect and its still not working?

    Are you sure it is still the same underlying Adobe account that was used when then books were originally accessed, with just the password changed?
    In that case, should just have continued working, but ... you are using the world's worst software so anything can happen.
    Try deauthorizing the computer and reauthorizing.
    ~~~~~
    Sometimes ADE gets its registration/activation confused and in a semi-authorized state.
    Uninstalling and reinstalling does not help, and indeed installation can even trigger this state.
    Unfortunately, it often then gives misleading error messages about what is wrong.
    A common incorrect message informs you that the ID is already in use on another computer and cannot be reused.
    Another is  "E_AUTH_NOT_READY"
    This can often be resolved by completely removing any authorization using ctrl-shift-D to the Library screen on ADE (cmd-shift-D if on Mac).
    Restart ADE, and then reauthorize with your (old) Adobe ID.
    In extreme cases on the mac, the following extra step has helped some people.  Navigate to /Users//Library/Application Support/Adobe/Digital Editions and drag the activation.dat file to the trash. If you are using 10.7, see Access hidden user library files | Mac OS 10.7 Lion. http://forums.adobe.com/thread/1265248?tstart=0

  • I changed my password on adobe digital and now I recieve an error message when I try to open epub

    error message
      Can anyone help ?
    Charles

    Are you sure it is still the same underlying Adobe account that was used when then books were originally accessed, with just the password changed?
    In that case, should just have continued working, but ... you are using the world's worst software so anything can happen.
    Try deauthorizing the computer and reauthorizing.
    ~~~~~
    Sometimes ADE gets its registration/activation confused and in a semi-authorized state.
    Uninstalling and reinstalling does not help, and indeed installation can even trigger this state.
    Unfortunately, it often then gives misleading error messages about what is wrong.
    A common incorrect message informs you that the ID is already in use on another computer and cannot be reused.
    Another is  "E_AUTH_NOT_READY"
    This can often be resolved by completely removing any authorization using ctrl-shift-D to the Library screen on ADE (cmd-shift-D if on Mac).
    Restart ADE, and then reauthorize with your (old) Adobe ID.
    In extreme cases on the mac, the following extra step has helped some people.  Navigate to /Users//Library/Application Support/Adobe/Digital Editions and drag the activation.dat file to the trash. If you are using 10.7, see Access hidden user library files | Mac OS 10.7 Lion. http://forums.adobe.com/thread/1265248?tstart=0

  • Keep getting 'NOT READY' error message when trying to re-authorize my computer after a hard drive re

    need help, very frustrated
    can not get it to work
    also having trouble with Reader, I get a message that the book can not be downloaded because it is already in my library but it does not appear and so I am unable to read it

    also having trouble with Reader  Do you mean with ADE (Adobe Digital Editions), or with an ereader device.
    Might be worth double-checking your authorization.
    If that doesn't help, post back with more detail.
    ~~~~~
    Sometimes ADE gets its registration/activation confused and in a semi-authorized state.
    Uninstalling and reinstalling does not help.
    Unfortunately, it often then gives misleading error messages about what is wrong.
    A common incorrect message informs you that the ID is already in use on another computer and cannot be reused.
    This can often be resolved by completely removing any authorization using ctrl-shift-D to the Library screen on ADE (cmd-shift-D if on Mac).
    Restart ADE, and then reauthorize with your (old) Adobe ID.
    In extreme cases on the mac, the following extra step has helped some people.  Navigate to /Users//Library/Application Support/Adobe/Digital Editions and drag the activation.dat file to the trash. If you are using 10.7, see Access hidden user library files | Mac OS 10.7 Lion. http://forums.adobe.com/thread/1265248?tstart=0

  • When I try to authorize a second computer to download books I get this error message

    "You can only authorize this computer with an Adobe Id that hasn't been previously used to authorize any other computer or mobile device"  I thought I could have several computers authorized at one time

    Sometimes ADE gets its registration/activation confused and in a semi-authorized state.
    Uninstalling and reinstalling does not help, and indeed installation can even trigger this state.
    Unfortunately, it often then gives misleading error messages about what is wrong.
    A common incorrect message informs you that the ID is already in use on another computer and cannot be reused.
    Another is  "E_AUTH_NOT_READY"
    This can often be resolved by completely removing any authorization using ctrl-shift-D to the Library screen on ADE (cmd-shift-D if on Mac).
    Restart ADE, and then reauthorize with your (old) Adobe ID.
    In extreme cases on the mac, the following extra step has helped some people.  Navigate to /Users//Library/Application Support/Adobe/Digital Editions and drag the activation.dat file to the trash. If you are using 10.7, see Access hidden user library files | Mac OS 10.7 Lion. http://forums.adobe.com/thread/1265248?tstart=0

  • Change default error messages

    Hello..
    I want to change the default error message in apex. for example I wanna change the Not-Null default error message so instead of "Field1 must have some value" I wanna get "Field1 must not be null".
    Thanks

    Hi Patrick,
    It’s an interesting reply, especially as the OP marked it as correct, but still I’m trying to understand something.
    As far as I can tell, you can use the translation system only for messages that was defined under a different language from the application primary language. For example, if you are working in English, and you are defining new text messages under English, with new text content, the Application Builder will ignore them as long as your application language is English (i.e. you can’t change/edit the internally used messages of your primary language). So, is this particular text message different?
    Thanks,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • Error message "SQL Statement ignored" while try to run an Funtion in APEX

    Hello All,
    In order to creating an application in APEX from CSV format i need to run below funtion.
    CREATE OR REPLACE FUNCTION bcl_custom_auth (
    p_username IN VARCHAR2,
    p_password IN VARCHAR2)
    RETURN BOOLEAN IS
    BEGIN
    FOR c1 IN (SELECT 1
    FROM bcl_employees
    WHERE UPPER(userid) = UPPER(p_username)
    AND UPPER(last_name) = UPPER(p_password))
    LOOP
    RETURN TRUE;
    END LOOP;
    RETURN FALSE;
    END;
    but i am getting below error message:
    Error at line 6: PL/SQL: SQL Statement ignored
    4. RETURN BOOLEAN IS
    5. BEGIN
    6. FOR c1 IN (SELECT 1
    7. FROM bcl_employees
    8. WHERE UPPER(userid) = UPPER(p_username)
    Could some body please check as i am new to PLSQL.
    Thanks & regards,
    Souvik Ghosh

    843873 wrote:
    Hello Edstevens,
    I did not understand your answer .Could you please elaborate.
    Thanks & regards,
    Souvik Ghosh
    Edited by: 843873 on Jul 8, 2011 11:43 PMNotice that the message had been edited? I changed my mind from my original, shot-from-the-hip, mesage, and simply deleted the entire content. would have preferred to delete the entire message but can't.

  • APEX 3.1 replaces HTML tags in error message automatically

    Hello!
    I have a problem: we use sometimes HTML links or even JavaScript in error messages. In older versions of APEX it works, but now we upgraded to 3.1 and in all those messages HTML tags are replaced so instead of link we get a plain HTML in a message.
    Are there any possibilities to turn this option off or what can we do to solve this problem?
    Regards,
    Maksim

    In a page process we use raise_application_error(-20547, 'Go to GOOGLE') and in a Process Error Message
    we use constuction Error: #SQLERRM#. Then on an standard error page we see instead of Error: Go to Google html source. Thats it. In template in Error Page Template Control section we use substitution #MESSAGE#

Maybe you are looking for

  • Supported Universal Adaptors for BI Apps 7.9.6.1

    Hi , we have BI Apps 7.9.6.1 and we are in a need to integrate 3rd party ERP (SCM/FIN) modules into it. Please let us know in 7.9.6.1 ,whether the Universal Adaptors were supported or not. while refering the oracle configuration document , we got the

  • Purchase Order Outbound Idoc issue. Message Type ORDER

    Hi Experts, I am having issue with outbound IDoc generated from Purchase Order.(Message Type ORDER and Basic Type ORDERS05) Issue is when i create PO idoc Segment  E1EDP01 and field ACTION populates as 001 this works fine. Now when made any changes t

  • VC Multiple Table Column Header Lines, Table Width Adjustment

    Hi Experts, 1) How to have Multiple headers for a column in a single cell i.e multiple lines in the same cell. please provide with example. 2) How to set your table to adjust the width automatically for all screen resolution since columns of the tabl

  • IMovie using automountd to access suspect sites?

    I have Litle Snitch installed and whenever I run iMovie 08 (7.1.4) it reports that automountd is trying to establish a connection with the following suspect web sites: AVCHD.com.au on UDP port 111 PRIVATE.com.au on UDP port 111 fs_usage shows lines l

  • OS X Server 10.6.4 - newly created user cannot login to server

    As title. Just turn on the mac mini server (mid-2010) and do some initial setup. It can access the internet. However, all users that I have created cannot log into the server! Only the one (admin account) that created during the 1st time server setup