Error Handling on procedure based forms

Hi all,
I have seen examples of error handling on table based forms like
the following:
begin
doInsert;
exception
when others then
--redirect to some error page
I have tried the same with a procedure based form by wrapping
the doSubmit procedure, but when the procedure returns an
exception, it doesn't execute my exception handling code.
Any ideas on why this is happening or at least how I can catch
these exceptions with my own exception handler?
Thanks,
Curt

Chetan, Antonio,
I opened a TAR on this issue with Oravle and they got the same
results. Thay suggested a work around of creating an error table
that gets written to and then dispaly and new page to retrieve
the error from the table.
What I ended up doing is creating a dummy procedure that does
nothing (NULL). The form based on the dummy procedure allows me
to get the values I need from the user.
The procedure always returns succesful since it doesn't do
anything. So in the form success code area I call the real
procedure, check the return value, and now I can redirect back
to the orignal form on error, or direct to another paqe on
success.
Not the most elegant solution, but it is working for now.
Curt

Similar Messages

  • Error handling in Portal standard forms

    I have a customer who needs to validate input on a Form Based on a Table (standard component). They have tried code, as shown below, as a PLSQL handler on a Save button. This example can obviously be solved with JavaScript validation on the client, but they have similar requirements for validation on DB level.
    If procedure call 1) in the if statement is used, nothing happens. If procedure call 2) is used, it is executed in a new page as a standard error Oracle Portal error message.
    declare
    v_sender VARCHAR2(1000);
    v_sender_id NUMBER;
    begin
    v_sender := p_session.get_value_as_VARCHAR2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SENDER');
    v_sender_id := p_session.get_value_as_NUMBER(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SENDER_ID');
    insert into hd (number, text) values (hd_seq.nextval,
    'step 3 v_sender = ' || v_sender ||
    ' v_sender_id = ' || v_sender_id);
    if v_sender_id >= 100 then
    1) Custom error handling, does not display:
    show_error('Error message');
    2) Error handling is displayed, but as a standard error:
    raise_application_error(-20000, 'SenderID must be smaller than 100.');
    else
    doInsert;
    end if;
    end;
    The customer has two questions:
    Why does the custom procedure in 1) "show_error" not execute, and if it does, why does it not display? show_error works and the if statement is entered.
    Is it possible to take control of Portals error handling on standard components (forms etc.), to show custom error messages with the style used on the component/page instead of the standard Error: ORA- ....etc. as Portal displays it?
    Customer needs reply asap. Please reply directly. Any help will be much appreciated!
    Kind regards
    Jakob Lund

    Jacob,
    Try following:
    declare
    v_sender VARCHAR2(1000);
    v_sender_id NUMBER;
    begin
    v_sender := p_session.get_value_as_VARCHAR2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SENDER');
    v_sender_id := p_session.get_value_as_NUMBER(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SENDER_ID');
    insert into hd (number, text) values (hd_seq.nextval,
    'step 3 v_sender = ' || v_sender ||
    ' v_sender_id = ' || v_sender_id);
    if v_sender_id >= 100 then
    p_session.set_value(
    p_block_name => "_block",
    p_attribute_name => '_STATUS',
    p_value => 'Sender ID must be less than 100!');
    -- return to your form with status message set
    -- and all fields filled with recent values
    return;
    end if;
    end;
    -- This point is reached only if validation is OK
    doInsert;
    Regards,
    Henn

  • Procedure Based Forms( a little !)

    Freinds!
    I have mada a form based on a package:
    ======================================
    Create or Replace Package vchrpro AS
    TYPE glrec is RECORD (company_code varchar2(4),
    voucher_type varchar2(4),
    voucher_seq varchar2(6),
    user_code varchar2(8)
    TYPE glcur is REF CURSOR RETURN glrec;
    PROCEDURE glquery(resultset IN OUT glcur,
    v_company_code in varchar2, v_voucher_type in varchar2);
    END vchrpro;
    show errors;
    Create or Replace Package Body vchrpro AS
    PROCEDURE glquery(resultset IN OUT glcur,
    v_company_code in varchar2, v_voucher_type in varchar2) IS
    BEGIN
    OPEN resultset FOR
    SELECT a.company_code, a.voucher_type, a.voucher_seq, a.user_code
    FROM gl_voucher a,gl_voucher_type b
    WHERE a.company_code=b.company_code and
    a.voucher_type=b.voucher_type and
    a.user_code=b.user_code and
    a.company_code=v_company_code and
    a.voucher_type=v_voucher_type
    ORDER BY a.voucher_type;
    CLOSE resultset;
    END glquery;
    END vchrpro;
    show errors
    ========================================
    the package is succesfully created and also
    the form.But the prob. is that i am not sure
    about the "Query Data Source Arguments" of
    a form's block property. i.e what i will
    give "Type Name" and "Value" to my procedure's parameter "resultset" (i have given nothing)AND when i run the form and
    execute the query error says:
    FRM-40505 Oracle error: unable to perform
    query.
    Kindly help me it is very important & urgent!
    also let me know if i have conveyed properly.
    Many thaks!
    null

    Take a look at
    "Forms and Reports Feature/Benefit Demos"
    that you can also get from: http://technet.oracle.com/sample_code/products/forms/content.html
    There is a sample of a procedure based form there.

  • Error in generating PDF Based form - SUI Report

    Hi,
    We are running Quarterly reports for Unemployment reporting at USA using tax reporter.
    We are not able to see the complete spool output for the Wage Type Listings but only just 1 page. In the tax reporter log we get the error "Error in generating PDF Based form HR_F_WLIST_CA" for respective states.
    Any idea how to resolve this.
    We are on ERP 6.04.
    Thanks,

    Hi,
    I think its  Basis problem.Ask basis gyus to repair the connection and try again.
    Regards,
    Manoj.

  • Error in printing pdf based forms

    Hi friends,
    Error in printing pdf based forms
    When we are trying to print pdf based forms.we get below error
    Cannot find PDL type for output device frontend printer
    Call contained error(s): ADS(2)
    Message No: FPRUNX003
    Thanks in advance.
    Please help

    Hi,
    launch following in INTERNET explorer.
    http://sapjavahost:50<instance_nr>0
    where sapjavahost = hostname of you SAP java stack host
             <instance_nr> = instance number of Java system
    this open sap j2ee engine start page.
    click on system information, login with administrator user and password
    under Software Components  you will find version and patch level.
    regards,
    kaushal

  • Error handling in master detail form

    Hi Guys,
    Apex 4.2.1
    I use the custum error handling of apex to customize the errror message.
    I add a row in the detail form with a dupicate key which is handled by the error function
    after submiiting the master record the error message is correct displayed but the row which generates the error is gone from the details.
    How to keep the record in the details visible?
    Thanks

    Hello 942793 -- Do you have a name / nickname? -- We still don't know how to address you,
    Say, could you tell us -- because sometimes different versions have different capabilities:
    Full APEX version number,
    Full database version number,
    APEX web browser architecture (EPG, OHS, or APEX listener)
    Browser(s) and version(s) used,
    Operating System with version number and architecture (32/64 bit),
    [If you mentioned these before we don't have access to that info in this thread.]
    Also, are you using ARP (Automatic Row Processing) for this Master-Detail or have you programmed your own updates?
    Did you use an APEX wizard to create the Master-Detail or have you written you own code for the Master-Detail?
    To the problem:  In short, APEX is ensuring update consistency by preventing an update of a record/row that has changed since the code retrieved it.  So, one needs to figure out where/why it changed and what to do about it.
    ?  Is this Master-Detail part of you application fairly simple?  Could you put just that part out on apex.oracle.com for folks to look at?  That can speed resolution of these, sometimes difficult, update problems.
    Regards,
    Howard

  • Error handler for event based messaging framework

    I've been very interested in using the event based messaging framework (described here http://forums.ni.com/t5/LabVIEW/Community-Nugget-2009-03-13-An-Event-based-messageing-framework/td-p...) for my next large application.
    My main concern is the fact that it seems like typos would be very difficult to debug since you need to ignore unknown commands to make this system work.
    To solve this problem I've been considering the idea of having a single message error handler VI which will store all valid commands and check all sent commands to see if they are valid.  Each VI would send out a register message on startup with their name and all messages they can send and receive.  The message error handler would store these and then check all future messages to be sure it is a valid message, throwing an error if it is not.
    My basic problem is this: for this to work the message error handler VI would have to be started before any messages are sent so that it can capture all the register events.  If this is a VI that will be continuously running the entire application how can I ensure it starts first since I cannot wait for it to complete? (I.e. the usual method of running an error out wire or using a sequence structure will not work since everything will then wait for it to complete which will not happen until the program is ready to shut down)
    I'm assuming the answer might be to use an asynchronous call but I'm not very familiar with this method.  
    Any help is appreciated.  Thanks. 

    Could you just use the error handler as a subVI inside a case structure that is only called when you have new message to be checked? I'm not sure I understood the exact functionality you are looking for, so sorry if this does not apply.
    Zach P.
    Product Support Engineer | LabVIEW R&D | National Instruments

  • Error when print PDF-Based form by code

    Hi all,
    I run debug my following code and i got a error : "Job already started" in step 3.
    Pls help to solve the problem, thanks alot
    My code:
    Step1:
      CALL FUNCTION 'FP_JOB_OPEN'
        CHANGING
          IE_OUTPUTPARAMS       = FP_OUTPUTPARAMS
        EXCEPTIONS
          CANCEL                = 1
          USAGE_ERROR           = 2
          SYSTEM_ERROR          = 3
          INTERNAL_ERROR        = 4
          OTHERS                = 5.
    Step2:
    Get the name of the generated function module
      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          I_NAME                     = u2018<form name>u2019
        IMPORTING
          E_FUNCNAME                 = FM_NAME.
    Step3:
    Language and country setting (here US as an example)
    fp_docparams-langu   = 'E'.
    fp_docparams-country = 'US'.
    Call the generated function module
      CALL FUNCTION FM_NAME
        EXPORTING
          /1BCDWB/DOCPARAMS        = FP_DOCPARAMS
      IMPORTING
        /1BCDWB/FORMOUTPUT       =
        EXCEPTIONS
          USAGE_ERROR              = 1
          SYSTEM_ERROR             = 2
          INTERNAL_ERROR           = 3.
    Step4:
    Close the spool job
      CALL FUNCTION 'FP_JOB_CLOSE'
      IMPORTING
        E_RESULT             =
        EXCEPTIONS
          USAGE_ERROR          = 1
          SYSTEM_ERROR         = 2
          INTERNAL_ERROR       = 3
          OTHERS               = 4.
      IF SY-SUBRC <> 0.
                <error handling>
      ENDIF.

    Problem is solved. Just change ProgramID in code.

  • Insert into a clob field in a procedure based form

    Hi,
    I have a table with a clob field. I wrote a procedure to insert into this table. Then I built a form based on this procedure. Here is my code:
    drop table clob_test;
    create table clob_test(id NUMBER, note CLOB);
    insert into clob_test values(10,empty_clob());
    Create or Replace PROCEDURE PROJECTS.SET_CLOB
    ( p_id IN CLOB_TEST.id%TYPE,
    p_note IN VARCHAR2 default null)
    as
    v_loc CLOB;
    v_amt binary_integer;
    v_pos integer :=1;
    v_clob varchar2(32000);
    Begin
    insert into clob_test values(p_id,empty_clob());
    v_clob := p_note;
    v_amt := LENGTH(v_clob);
    select note into v_loc from clob_test where id = p_id;
    DBMS_LOB.WRITE(v_loc,v_amt,v_pos,v_clob);
    End;
    When I try to insert into note field more than 4000 charaters. I got this error:
    An unexpected error occurred: ORA-06502: PL/SQL: numeric or value error: character string buffer too small (WWV-16016)
    Why this happens? I know portal form doesn't support clob, but this procedure deal directly with database. Can anyone from Oracle give me help? Thanks in advance!

    I use a dynamic page instead of a form on the procedure. It's working.
    Apparently Oracle is not supporting a varchar2 more than 4000 in any form format, even using textarea for p_note.

  • Error when calling procedure from form personalization

    Hi every body
    I want to call a procudre using form personalization . I made the procedure and in form personalization i call it as follow:
    built in type : Execute a Procedure
    Argument :
    ='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )'
    but the following error raised when i click on Apply Now button :
    the string (='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )' )
    couldn't be evaluated because of error ORA-06550 :line 1 , column 43
    PLS-00103:encountered the symbol ")" while expecting one of the folowing (- + ...... etc
    can anyone have a solution to this problem because it made me mad .(urgent)
    Or if anyone have another way to call the procedure ??
    Note that i want to pass db_session_id to the procedure from the application so does anyone have a complian about the way of passing this parameter to the procedure ??

    See http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/forms-personalization-execute-a-procedure-1778674

  • Error with a procedure in Forms 6i

    Hello,
    hope someone can help:
    I’m running Forms6i client /server and have a problem with a procedure. What I wish to do is to fill some text_item in a block with values from a query like this:
    Procedure test is
    BEGIN
    select distinct ( pc.d_id), pc.min_value, pc.max_value, pc.def_value, pc.act_value
    into :blk_multi.c_id,:blk_multi.txt_multi_min,:blk_multi.txt_multi_max, :blk_multi.txt_multi_def, :blk_multi.txt_multi_old_value
    from par_car pc, c_list cl
    where pc.par_id = 21 and pc.d_id IN (select cg.ce_id from cel_group cg where cg.gr_id like 'TEST') and
    pc.d_id = cl.c_id
    order by pc.d_id desc;
    end;
    In my form I have a button and in trigger WHEN-BUTTON-PRESSED I call this procedure. It returns error message FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06502. What causes this error message?
    Regards
    Roar

    Roar,
    2 comments:
    1. Query into PLSQL variables and not forms fileds. After a successful query, set the value in teh variables to teh forms fields
    2. another problem with your implementation is that it breaks when many rows are retruned. You should use a cursor that loops trhough the query result sets. This way you are save.
    Frank

  • Procedure Based Form with master details Relationships

    Helo All
    Here i m having some problem in making one form which is having 2 tables one is master and other is detail table and i already made relationship between them but still i make both forms at that moment form didn't make the auto relationship.even after taht when at the form level i made the relationship between 2 tables it made but at teh compilation time it gives error.
    Actually one table was there at that time it worked but with relation it creates problem.
    Can anybody give me any idea how to sort out this problem.

    Helo Frankin
    Actualy the error came when i made the master detail relation manualy.but as per me if both tables have relationship with each other then no need to create it manualy isn't it?
    even after that i created teh relation manaualy but at the on clear block details trigger it showed compile time error.
    If possible can u give me any live example for this
    TQ
    Vivek

  • Error Handling in Oracpe form 9.4.0

    Hi,
    Have you got good documentaion about error handling in Oracle form 9.0.4? If yes, Could you let me know?
    Many thanks
    Michael

    Michael,
    Although, link I'm listing here is for Forms 4.5, the concepts of Error Handling still apply as Forms Error Handling has not changed significantly.
    [Oracle Forms Developer and Forms Server Documentation|http://www.oracle.com/technology/documentation/forms.html]
    Select the "A32506_2      PDF           Forms 4.5 Advanced Techniques" option.
    You can also try the [Oracle9iDS Forms Developer Reference Guide|http://www.oracle.com/technology/documentation/forms/902docs/9iRefGuide.zip] from the [Link to Oracle Forms 10g (10.1.2), Oracle Forms 10g (9.0.4), and Oracle9i Forms (9.0.2) Documentation|http://www.oracle.com/technology/documentation/9i_forms.html]. This is a .zip file which contains the "Forms 9i Reference Guide" pdf file.
    Hope this helps.
    Craig...

  • Procedure based blocks - error using Forms 6/8i/NT

    A simple form with a procedure-based block fails with the Lock procedure, giving an ORA-03114 error. I believe there is some known bug with procedure-based blocks using Forms 6 and Oracle 8i over NT. The Query procedure (based on a ref cursor) works fine, but the Lock, Insert and Delete triggers (and presumably the Update trigger too - without a Lock I can't get that far) return the error (these are based on a table).
    Does anyone know if this is a known bug? The same form has run successfully using Forms 6/Oracle 7.3/VMS.

    It's a known bug and the patch is available through MetaLink.

  • Error Handling in Forms

    Dear all,
    we are using oracle developer suite 10g r2 with oracle database 10g r2 against windows server 2003.
    Error handling is a very big issue.
    i try to do the following, just correct me, or make the trigger more efficient.
    i face unexpected messages, like a message two time displayed, sometime important message never displayed.
    i just set the :system.message_level =20 in the when-new-form-instance trigger.
    and create on-error trigger like below
    declare
    errcode number:=error_code;dbmserrcode number;dbmserrtext varchar2(200);
    formtxt varchar2(200);
    errtype varchar2(3);
    begin
    --------- user defined database exceptions errors raised by --RAISE_APPLICATION_ERROR
    IF DBMS_ERROR_CODE in (-20738,.......) then
    raise form_trigger_failure;
    end if;
    if error_code=50017 then
    message('duration must be between 0 and 23');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif
    error_code=40202 then
    clear_message;
    message('please provide the required fields.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif error_code=50022 then
    clear_message;
    message('time must be in the correct format.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    if error_code in (40509,40508) then
    dbmserrcode:=dbms_error_code; dbmserrtext:=dbms_error_text;
    if dbmserrcode=-1438 then
    clear_message;
    message('your number is too large.try again.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-1400 then
    clear_message;
    message('your forgot to provide a value.try again.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-2291 then
    clear_message;
    message('header is not found for this insertion.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-1 then
    clear_message;
    message('record already exists');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    else
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    else
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    exception
    when others then
    if dbms_error_code=-20738 then
    clear_message;
    message('Error: absent or later record errror from the database trigger.);
    raise form_trigger_failure;
    elsif .....
    esle
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    end;any suggession?
    Regards

    i must come with a plsql code which handle every error and suppress unnecessary messages.Good luck with that. No matter how well thought out or planned, you're not going to be able to take all scenarios into account. The design of an exception handler takes time to address all possible scenarios you want handled and even then, you're not likely to handle every situation in the beginning.
    could we implement the oracle ebusiness error handling procedures here in our application?if yes, then where could we find that procedure?>
    I've dug through that code and it is not a thorough as you think it is. It handles specific situations and then defaults the rest. It is a good model for your own exception handler, however. That is what I used it for. :) I don't recall which library it is in, but I'll look around and if I find it, I'll post it.
    I agree with Andreas's comment...
    Simply remove your ON-ERROR-trigger, then you have a default. That's nothing better or worse than what apex has.I'm not too familiar with Apex; I've worked with it, but it's been a little while. Even with Apex, you're going to have to develop a customized Exception Handler so more intuitive or application specific messages are displayed in response to an exception.
    As to Andreas's comment...
    For your own error-handling... The "simplest" way in my eyes is create your own error-table where you have appropiate columns for the error-code and the error-type (FRM,ORA,Whatever), then in your ON-ERROR-trigger read the appropiate record from that table and show the error. You could also have a flag in your table which decides what to do with a specific error (Show as Message, Show as Alert, Don't show at all) and react accordingly.This is exactly what we implemented in our application. We created a set of tables that contain all of the Oracle Runtime errors and their attributes (Error Type, Severity Level, etc). Then we wrote a standard On-Error trigger that is subclassed to all of our forms that calls a Library "On_Error" package. This package evaluates the exception raised, compares it to the database entry for the error and then displays an appropriate message depending on the Severity Level, Error Type (ORA or FRM) and Message Type (Informational, Error, Caution) and we display the message in either the Status Bar, Note Alert, Caution Alert or Stop Alert or it is supressed. If an error is not found in the table, then it is displayed in a Stop Alert as an "Unhandled Exception." The second table I mentioned contains all of the messages used by our application and is cross referenced with the table that contains the Oracle messages. By simply assigned one of our messages to an Oracle message - our package will display our message instead of the default Oracle Message. Yes, this took sometime to build and test and once implemented, we spent another couple of months perfecting it, but now it is pretty solid and we haven't had to modify it in over a year.
    While this level of complexity may be overkill for your application, it does offer the greatest flexibility in the long-run. Also, if your application must support multiple languages, having all of your messages in a table make internationalization extremely easy. :)
    The point of all this, is that no matter which system you use (Forms, Apex, or Java) you will still need to invest some time into designing an Excpeiton Handling method for your application and then implement it accross the application. This is not something you can develop in a short period of time and it will not be perfect in the beginning. However, in the long-run, you will be happy you spent the time up-front to build a flexible and robust Exception Handling system.
    Craig...

Maybe you are looking for

  • ARQ: Are "Valid From" and "Valid To" dates are considered for risk analysis???

    Hi All, I have one question w.r.t. risk analysis of user while raising a request in ARQ. I have noticed that, when a user is assigned 2 conflicting roles in a request (with "Valid From" and "Valid To" fields being the same), ARQ shows risk violations

  • KDE websites offline

    KDE has put their websites offline in search for a sponsor.  http://www.kde.com/

  • Multiple SAP systems in MSCS Master DVD

    Hello, We are going to install a second SAP system in a MSCS cluster and following the installation guide "Installation of Multiple SAP Systems in MSCS: Oracle" I have been looking for the new installation Master CD for the Multi-SID MSCS Installatio

  • Safari 4.0.3 Totally Broken With Sno Leo or I Can't Reinstall Safari Blues

    Sno Leo 10.6.1 has busted Safari 4.0.3 and it cannot be reinstalled with Sno Leo running. What the h'ay? It's all because Mercury is in retrograde and it won't let up until October. Sometimes you just gotta ask yourself if it's all worth the trouble.

  • Fed up with "updates": to whom belong MY phone?

    Short story. After one or two months without doing it (was I lasy?), I had the stupid idea of checking software updates for my N8. Was not at first easy, since the Ovi suite (after upgrading to last version) kept cheking for hours for "software updat