Tabular presentation - Trigger error

Hello

I have a question about the errors of a trigger seizures in a tabular presentation.

The situation:
I use a tabular form for insertion of a row in A table.
The trigger validates the insert and get a custom error [+ Raise_application_error ("-20001, ' INSERT NOT VALID"); +].
As I put "+ error message display location Inline in Notification +" with process Error Message: + #SQLERRM_TEXT #+.

I expect to get "1 error has occurred" with only the message "+ INVALID INSERT +".
But what I see is
INSERT NOT VALID ORA-06512: in "SCHEMA. TABLE_TRIGGER', line 23 ORA-04088: error during execution of trigger.
+' SCHEME. TABLE_TRIGGER' (1st row) +.

So is it possible to change this type of validation to only see that my custom error message?
Thanks in advance!

Hi fyaa,.

Please take a look at the example of http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_error.htm#CABDJBGJ of error handling function
Especially the code block

        -- If an ORA error has been raised, for example a raise_application_error(-20xxx, '...')
        -- in a table trigger or in a PL/SQL package called by a process and we
        -- haven't found the error in our lookup table, then we just want to see
        -- the actual error text and not the full error stack with all the ORA error numbers.
        if p_error.ora_sqlcode is not null and l_result.message = p_error.message then
            l_result.message := apex_error.get_first_ora_error_text (
                                    p_error => p_error );
        end if;

is what you are looking for. If you are just curious to see the client error message and do not want to have everything, your error management function might look like

create or replace function apex_error_handling_example (
    p_error in apex_error.t_error )
    return apex_error.t_error_result
is
    l_result apex_error.t_error_result;
begin
    l_result := apex_error.init_error_result (
                    p_error => p_error );

    if not p_error.is_internal_error then
        -- If an ORA error has been raised, for example a raise_application_error(-20xxx, '...')
        -- in a table trigger or in a PL/SQL package called by a process and we
        -- haven't found the error in our lookup table, then we just want to see
        -- the actual error text and not the full error stack with all the ORA error numbers.
        if p_error.ora_sqlcode is not null and l_result.message = p_error.message then
            l_result.message := apex_error.get_first_ora_error_text (
                                    p_error => p_error );
        end if;

        -- If no associated page item/tabular form column has been set, we can use
        -- apex_error.auto_set_associated_item to automatically guess the affected
        -- error field by examine the ORA error for constraint names or column names.
        if l_result.page_item_name is null and l_result.column_alias is null then
            apex_error.auto_set_associated_item (
                p_error        => p_error,
                p_error_result => l_result );
        end if;
    end if;

    return l_result;
end apex_error_handling_example;

Also take a look at my blog announcement at http://www.inside-oracle-apex.com/apex-4-1-error-handling-improvements-part-1/

Concerning
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf

Tags: Database

Similar Questions

  • Tabular presentation - PK_DISPLAY with name

    Hi all

    Request Express 4.2.4.00.08

    I have setup an example on apex.oracle.com.

    Workspace: BRENTDEMO

    user: demo

    PW:demo

    On page 2, I have a dynamic action

     jQuery.each($('input[name="f03"]'), function() {
         alert('Name = ' + $(this).val());
         var deptno =$(this).closest('tr').children('td[headers="DEPTNO_DISPLAY"]').find('input[name="f02"]').val()
         alert('deptno = ' + deptno);
    
     })
    

    If you use firebug on the page, the DEPTNO_DISPLAY column has no name/id associated so obviously that this action will not warn the correct value.  How I would go about assigning an id/name of the DEPTNO_DISPLAY column to retrieve the value.  I want to get this value it is because I have a how to remove custom that needs the PK ID.  (Not in this application example).

    I tried to make the column DEPTNO_DISPLAY a text field (changing names in dynamic action).  However, it gives an error message of "current version of the data in the database has changed since the user initiated the update process. version of current line identifier = "6FC404C2EDDB998C91CD7473B6DDA6A5" line application version identifier = "D3B1B18D31905688985A3EA6D5F82FB2" (line 1).

    On page 3, I tried to adjust the sql query to read

    select 
    "DEPTNO",
    "DEPTNO" DEPTNO_DISPLAY,
    "DNAME",
    "LOC",
    apex_item.text(10,deptno) as deptno_with_name
    from "#OWNER#"."DEPT"
    
    

    With dynamic Action

     jQuery.each($('input[name="f03"]'), function() {
         alert('Name = ' + $(this).val());
         var deptno =$(this).closest('tr').children('td[headers="DEPTNO_WITH_NAME"]').find('input[name="f10"]').val()
         alert('deptno = ' + deptno);
    
     });
    

    This allows all work fine, except when a validation fails on the page.  If you set Dname null and try to send the page, the following error message is displayed in the form of tables:

    error report:

    ORA-01403: no data found

    ORA-06510: PL/SQL: not supported by the user-defined exception

    Now, if you are populating Dname with what either, and you're trying to send the page again, you receive the following error message:

    Current version of the data in the database has changed since the user initiated the update process. version of current line identifier = "A884FA378C851786DDFE3A33709CB23C" line application version identifier = "6FC404C2EDDB998C91CD7473B6DDA6A5" (line 2)

    I tried searching forums and I believe that page 3 does not work because the mixture of apex_items and a Query (updateable report) "SQL" does not work.  Please correct me if that's wrong.

    Does anyone have a solution on how I can retrieve the value of DEPTNO? Is the best solution to use a tabular presentation manual?  If more information is needed, please let me know.

    Thank you

    Brett

    What about just using the text() td value?

    The javascript code for your dynamic action reads as as follows, and the alert shows what is desired:

     jQuery.each($('input[name="f03"]'), function() {
         alert('Name = ' + $(this).val());
         var deptno =$(this).closest('tr').children('td[headers="DEPTNO_DISPLAY"]').text();
         alert('deptno = ' + deptno);
    
     });
    
  • Look for the lines selected on a tabular presentation

    Hello guys and girls,

    I have a small problem trying to understand if/how I can check by pressing the "submit" button if there where no records selected in my tabular presentation.

    To explain better: I have a selection list in which the user select an employee. On this choice, a tabular presentation appears with the own products for this employee.

    The user must check at least one of the lines to go further.

    If the user does not select all and always press the "submit" button you should see an error message saying: "there are no selected product."

    What I was doing until now (stupid I suppose) was to create a Boolean as validation:

    DECLARE

    vRow directory;

    BEGIN

    BECAUSE me in 1... apex_application.g_f01. COUNTY

    LOOP

    vRow: = apex_application.g_f01 (i);

    If vRow is NULL then

    Returns false;

    on the other

    Returns true;

    end if;

    END LOOP;

    END;

    But does not work. If I have no active records it will say nothing and let me go. If I check something even record.

    Help, please.

    There must be something that I have no idea about.

    Thank you very much.

    Gabriel

    Checkboxes only support values for the lines. For example, a loop on the table will always return true since vRow will never be NULL. In addition, a table with a number equal = 0 will not be locked during all, again don't generate no errors.

    No loop, just check apex_application.g_f01. COUNTY. If it is 0, no checkboxes have been verified.

  • How to apply the color to the line in a tabular presentation

    Hello

    My requirement is to apply the color to the line in a tabular presentation according to the conditions of the column value.


    Thank you

    1243 Tulasi wrote:
    I created a form of demo using the emp table

    but now it throw an error like "error report:"
    ORA-06550: line 1, column 29:
    PLS-00201: identifier 'CLERKS' must be declared.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    http://Apex.Oracle.com/pls/Apex/f?p=16091:1:12227641756607:

    Workspace: tipper
    username: guest
    password: demo

    Please help me on this very urgent issue.

    Thank you.

    Check it now, only it was you must reference column names using bind variables syntax not #XXX #.

    Refer to the help when you click on * model column 1 Expression * in your report model.

    also, I noticed that you lose the background color when you mouseover it. To do this, you may need to remove the #HIGHLIGHT_ROW # of your model.

    See you soon,.
    Vikram

  • Get the selected value of a select list item in a tabular presentation.

    Hi, I have a tabular form and I'm trying to get the selected value of a select list item and store the selected value in a page element hidden elsewhere on the form of tables, so I can use this value.

    I already have something similar to the input on the tabular presentation elements.

    Get the initial values
    var line = $x_UpTill (this.triggeringElement, 'TR');
    numberOfItems var = $(' input [nom = "f12"]', ligne) [0];

    numberOfItems = 123456.123

    What I want to do is soemthing similar as above but capture the value of a select element in tabular form. I thought I could do something like:

    Get the selected value
    var line = $x_UpTill (this.triggeringElement, 'TR');
    numberOfItems var = $('selected [name = "f08"] .val ()', line) [0];

    But this method leaves the as undefined var numberOfItems.

    Please help me to find a way to identify the item 'select' in the tabular form called "f08" and get this value.

    I am a newbie to jQuery selectors etc...

    Thank you.

    Strange that you do not get an error when you run your 2nd selector.
    In any case for this kind of thing, see the HTML code of your tabular form and tell us what triggers, the element can be useful. Or better create an example at apex.oracle.com.
    In any case, I see two errors:
    (1) is there any html element "not selected" instead, the LOV in the APEX element has the select tag
    (2) you can not write a. val() inside a selector that you must place it after your selection.

    So I'd like to rewrite your code to:
    var line = $x_UpTill (this.triggeringElement, 'TR');
    numberOfItems = $("select_[nom_="f08"]",_row).val () var [0];

  • MRU - tabular presentation - Validation

    Hello

    I have the following problem:

    -J' have a tabular presentation
    -This form has 4 columns
    -the 3rd column has a text field to type a number (it is also declared as 'number' in the table)
    -with a MRU certain changes in the 3rd column may be saved

    --> The user must type in the quantity of items the found.


    My problem:
    Some users may type in a white (not 0). -> and if he wants to save it, an error message is: internal error in the routine mru... There is an invalid number.


    My question:
    How can I validate the 3rd column that the user can type only number and not characters?




    Thank you very much
    LISA

    Lisa,

    I had a similar problem, although I used it to validate a deletion: validation in the form of integrity constraint?

    You can add validation: pl/sql returns the error message.

    and then apex_application contains an array of items in the form of tables... so, you could do something like:

    for i in 1..apex_application.g_f02.count loop
        --insert logic here
        if apex_application.g_f02(i) = 0 then
            return 'Please remove any values that are equal to 0';
        end if;
    end loop;
    

    g_f03 <-- that="" generally="" refers="" to="" the="" 3rd="" column,="" but="" you="" can="" confirm="" by="" inspecting="" the="" element,="" it="" will="" generally="" have="" a="" name="" of="" something="" like:="" f03=""><--- that="" is="" what="" you="" use="">)

    Digital test: http://www.techonthenet.com/oracle/questions/isnumeric.php

    Van
    Trent

  • Best approach to call a javascript function in a tabular presentation

    Hi all

    I have a manual tabular presentation. In this form, I have a javascript function that disables hiredate column. The function is called on the deptno column change.

    So, if I select the "Research" Department and hire date field is disabled for the selected line.

    I need to run this function also executed automatically on page load. So, it checks if all rows with deptno as search and disable hiredate field for these lines.

    Please let know us the best approach to achieve this goal, which does not affect the performance that the page has 2000 lines.

    function test2 (pThis) {}

    var v_item_value = pThis.value;

    var v_hiredate_item = $(pThis).closest('tr').find ('td [headers = HIREDATE] input [name = f05]');

    var v_hiredate_button = $(pThis).closest('tr').find ('td [headers = HIREDATE] button "");

    var currIndex = $('select[name="'+pThis.name+'"]').index (pThis);

    var currRow = currIndex + 1;

    If (v_item_value == '20') {}

    v_hiredate_item.prop ('readOnly', true);

    v_hiredate_button.prop ("disabled", true);

    document.getElementById("f08_"+[currRow]).disabled = true;

    }

    else {}

    v_hiredate_item.prop ('readOnly', false);

    v_hiredate_button.prop ("disabled", false);

    document.getElementById("f08_"+[currRow]).disabled = false;

    }

    }

    Thank you

    Zkay

    Try this:

    Suppose that the deptno column name is "f08".

    execute a javascript script that triggers the loading of the page

    $("[name=f08]').change ();

  • Tabular presentation - column to turn it off (with picture) based on another value of the column

    Hi all

    I haven't worked much on tabular forms and JS. I'm looking for help in this regard.

    I'm working on a tabular presentation. with several editable fields... I need to disable a column (just for this single line), which contains an image, based on a field of LOV (static) list) (Y/N). The image column must be disabled if the value is N.

    My SQL for the report is something like this: (will keep things simple)

    Select

    emp_id,

    emp_name,

    static_list,

    (case when STATIC_LIST = "Y" THEN ' < a title = "Edit SAMPLE TBL" href = "f?) p = & APP_ID.:10: & APP_SESSION.:NO:P10_EMP_ID, P10_EMP_NAME :'|| EMP_ID | «, » || EMP_NAME | "" "> < img src =" "#IMAGE_PREFIX #SAMPLE.gif" border = '0' (> < /a > ' other ' ' end) as disable_col, "

    dept_name

    of sample_table

    I scoured the topics in this forum. Most of them were made using the table ID f_001, f_002.

    I tried to follow the same path by inspecting the item but the disable_col does not have any ID.  Let's say, f_003 is for the static list and f_004 is assigned to dept_name.

    I tried dynamic actions, but it did not work. Read in a topic that dynamic action does not work on tables. So I chose this approach. Is there a simpler way to solve this?

    need your help on how to proceed with this scenario. Thank you in advance.

    Versions: Apex: 4.2, DB: 11 g

    Thank you

    Daniel

    Hi Daniel_A,

    Daniel_A wrote:

    I did my job in Page 4.

    If the IS_VALID column is select as 'Yes' then the column hyper must be enabled, allowing the user to click on it. If she chose the 'no', then the column Hyper must be disabled for this line.

    The initial question about toggle the hyperlink is resolved. Check your App-> Page 4 35160.

    This is done with the help of two dynamic actions:

    • DA first loading of the Page / after updating of region "tabular":

    Event: After refresh

    Selection type: region

    Region: The other 'tabular '.

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $( 'select[name="f08"]' ).each(function() {
      if ( $(this).val() === "N" ) {
        $(this).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click");
      }
    });
    

    Items concerned: no item affected

    • Second DA on the evolution of the selection list:

    Event: change

    Selection type: jQuery Selector

    jQuery Selector: select [name = "f08"]

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: No.

    Code:

    var el = this.triggeringElement;
    if ( el.value === "N" ) {
        $(el).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click");
    } else {
        $(el).closest("tr").find('td[headers="HYPER"]').find("a").removeClass("apex_disabled").bind("click");
    }
    

    Items concerned: no item affected

    NOTE: as the original question/topic related to toggle the image link in the column, for the problem with the Page 5, please create a new thread with the details.

    Kind regards

    Kiran

  • FRM-40735: trigger ERROR raised unhandled exception ORA-06508

    I am having this error when executing my form this error before the page load screen I have not een know what trigger causes error

    FRM-40735: trigger ERROR raised unhandled exception ORA-06508'm in oracle 11 g 2 of the form how to find on which trigger causes error

    Hello

    Below is the cause of the error and for more information, see the link below.

    Question: An attempt was made to call a stored program that cannot be found.

    ORA-06508: PL/SQL: not found unit of programs called tips

    Oracle/PLSQL: ORA-06508

  • How to access a column value in a Select list in a tabular presentation for each line

    Hello

    Environment: Using Oracle APEX v4.2.1 on an Oracle 11 g 2 DB

    In a tabular presentation using the following example query, i.e.:

    select
    "EMPNO",
    "EMPNO" EMPNO_DISPLAY,
    "ENAME",
    "HIREDATE",
    "SAL",
    "DEPTNO",
    "MY_LOV"
    from"#OWNER#"."EMP"
    
    

    I need access to every line of my sub form of table, the EMPNO of this line value, within a list of selection (query based LOV) in the column "MY_LOV."

    So, basically, the MY_LOV column in my table presentation, would be a list of selection (query based LOV) where MY_EMPNO =: EMPNO (first column in the select statement above), for each line of the tabular presentation.

    With the help of a picture ( Tom's Blog ) and assuming 'Deptno' column here is actually my new column, i.e. "MY_LOV, I want to know how this list of selection based on lov query would be able to access each EMPNO down in the form of tables, i.e. 7839, 7698, 7782 etc.?

    overview.png

    Any help would be appreciated.

    Thank you.

    Tony.

    Hi Tony,.

    Take a look at the API APEX_ITEM for LOV

    http://docs.Oracle.com/CD/E37097_01/doc/doc.42/e35127/apex_item.htm#AEAPI208

    Kind regards

    Brad

  • I need to rename a column for a tabular presentation

    How to rename a column, I created for a tabular presentation?

    I added a new column to a tabular presentation (using 'add a new link in the column') and he gave me a name of column, called "link column. I tried to change, but it does not - note: I can't change a sql column does not exist outside Apex - I created it for the display of a calculation.

    I don't know that it can be done as I did before.

    change the column name photo columnnamechange.png

    Does not change the name of  photo colunnamechange.png so cannot reference in my calculation

    Well, I found a way to do it anyway. This should be changed in the definition of region > source.

  • Is it possible to create an edit on a tabular presentation on Apex option?

    Is it possible to create an edit as on an interactive report option.  photo report2.png , But on a tabular presentation  photo apextabform.gif I want to make a link to a form for a selection of special line, which will have also one tabular presentation for another table.

    found the way to do even when trying to do something else. pretty lucky.

  • Dynamically set read-only columns in the tabular presentation at record levels

    Hello

    Is it possible to activate and deactivate fields at the level of the line in a tabular presentation... I use OFA to create a page that should give the possibility to activate and deactivate certain fields in the table on the fly...

    Here's the requirement:

    examples of data

    Item_code |   Review | Point Attrib1 | Article attrib2 | Article attrib3 | Columna | ColumnB

    1.234               100           A                         B                    _                  A               _

    1.235               100          B                              _                 B                 _                   A

    fields point attrib3 and Columnb should be read-only if the value of attrib1 point is A

    Even if point value attrib1 is B columna and attrib2 of the element must be read-only...

    I have PPR on item_attrb1 to manage the change of value in the attrib1 element, but I'm not able to make fields read only at the level of the line... Please help me if someone has work around this

    Is this possible?

    Thank you

    Dilip

    Hello..

    It is possible. Made myself.

    You must use SPEL for this.

    Steps to follow:

    1. the Caisse one type of transitional say as Boolean column ReadOnly

    2 set the Readonly property for that column as ReadOnly

    (Syntax FRO SPEL-> {oa. VO. ReadOnly})

    3 al ' PPR after checking the status, the ReadOnly Anaïs value accordingly.

    .

    You can get the idea here.

    https://blogs.Oracle.com/manojmadhusoodanan/entry/hiding_an_item_conditionally_through

  • What should I do for default values when a new line is created in a tabular presentation?

    Hello all-

    I have a tabular presentation that requires a few columns to be entered by the user when he or she creates a new line, but other fields in the column can just default to certain values.  How to set these values by default so that the user doesn't have to be bothered with enter no data except those which MUST be entered?

    An example:

    Form1

    CITY OF COUNTRIES IN THE REGION

    APAC JAPAN TOKYO

    SIDNEY AUSTRALIA, APAC

    APAC KOREA-SEOUL

    REGION is almost always APAC, then I want that by default.  The user can always adjust if necessary, but I want to put it to the user, only to save having to enter a value.  When the user clicks on the button to add a line, that I want to load this value immediately and leave the two empty fields so the user can enter what they want.

    Thank you!

    John

    Hello

    Go change this column.

    Under attributes of tabular form, you will find options to set the default value

    Kind regards
    Jari

  • Problem with BLOB in a tabular presentation manual

    Hi all

    I created a manual tabular presentation. One of the elements is a BLOB type and shown as file browse on the form.

    I'm going to show a download link when the blob column is not null.

    I searched the forum and tried many ways, but nothing has worked so far. The form is available at apex.oracle.com.

    Here are the credentials to connect:

    Workspace: bobforum

    User: forum

    Password: abc123

    Application: 39196

    Page: 1

    http://Apex.Oracle.com/pls/Apex/f?p=39196:1

    I would be grateful if someone can help on this please.

    Thank you

    Zkay

    Hello

    Check your sample now.

    It should work, when inserting blob column files

    Kind regards
    Jari

Maybe you are looking for

  • Transfer information from the old hard drive to new

    I have a desktop compaq presario with hard drive failure and I was wondering the best method for transfer of norton 360 and other info on new hard drive.

  • Select the URI address bar

    I use both systems, at work and another at home, they are all two Windows XP SP3. At work, when I click once on the contents of the location bar, the full URI is selected. However, at home, it takes several clicks to select the entire line. Is there

  • Call ExtProgram

    I am under DIAdem version 11.1 and try to use the command Call ExtProgram. A call toCall ExtProgram ("excel.exe", "G:\A folder Name\File Name.xls") called excel OK but then attempts to open .xls A.xls then folder and Name.xls. I tried to use the doub

  • Computer infected with the Blaster worm

    original title: Blaster worm My PC (Vista OS) is infected with the Blaster worm and it won't work no matter what removal tools when I download them.  When I try and run an alert appears and tells me that the tool is infected with the Blaster worm and

  • BlackBerry passport how to change the slogan to end of email?

    Hi, how do I change the "sent from my...» "slogan at the bottom of each email? I wish I had a sig for each instead. Thank you.