Solved

FRM-40735 / ORA-01422 / FRM-40222 / FRM-40735 Runtime Erros

Posted on 2004-09-22
5
16,580 Views
Last Modified: 2011-08-18
Hello,

Well, I compiled my application, when I call the main form and press on some tabs I get the following sequence of errors:

1) FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-01422
2) FRM-40222: Disabled item B1_BILLED failed validation

And then back to 1 and 2.

1) How can I resolve this sequence of trigger errors ?

PT
0
Comment
Question by:ptreves
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:anand_2000v
ID: 12130109
Due to some reasons you have a select command in the when-validate-item trigger which retrieves more than 1 record.
Either handle the exception using exceptions or tune ur command to access only one record.
0
 

Author Comment

by:ptreves
ID: 12145137
Hello,

Here is the source code for the DATA_BLOCK=B1, ITEMS=BILLED, TRIGGERS=WHEN-VALIDATED-ITEM:
---
DECLARE
   DUMMY VARCHAR2(1);

BEGIN
   SELECT CODE
   INTO   DUMMY
   FROM   TBPRJSTATUS
   WHERE  CODE = :B1.STATUS;

EXCEPTION
   WHEN NO_DATA_FOUND
   THEN MESSAGE('Invalid project status');
        RAISE FORM_TRIGGER_FAILURE;
END;
----

Your toughts ...

PT
0
 

Author Comment

by:ptreves
ID: 12145215
Hello,

Here is the source code for the DATA_BLOCK=B1, ITEMS=STATUS, TRIGGER=WHEN_VALIDATE_ITEM:
-----
DECLARE
   DUMMY VARCHAR2(1);
BEGIN
   SELECT CODE
   INTO   DUMMY
   FROM   TBPRJSTATUS
   WHERE  CODE = :B1.STATUS;
   IF GET_ITEM_PROPERTY('B1.STATUS',DATABASE_VALUE) = 'P' AND :B1.STATUS = 'A' THEN
      :B1.PROJ_TYPE := '1';
      CHANGE_PROJECT_NO;
   END IF;
EXCEPTION
   WHEN NO_DATA_FOUND THEN
      MESSAGE('Invalid project status');
      RAISE FORM_TRIGGER_FAILURE;
END;

-- Le client n'est pas modifiable pour les projets dont le
-- statut est R(eceivable) ou C(losed).

BEGIN

      IF :B1.STATUS = 'R' OR :B1.STATUS = 'C'
      THEN  Set_Item_Property('B1.CLIENT', UPDATEABLE, PROPERTY_FALSE);
            Set_Item_Property('B1.CLIENT', ENABLED, PROPERTY_FALSE);
      ELSE  Set_Item_Property('B1.CLIENT', ENABLED, PROPERTY_TRUE);
            Set_Item_Property('B1.CLIENT', UPDATEABLE, PROPERTY_TRUE);
      END IF;

      IF :B1.CLIENT IS NULL THEN
            MESSAGE('The client is mandatory');
      END IF;
END;

-----

Your toughts....

PT
0
 
LVL 5

Expert Comment

by:FBIAGENT
ID: 12147192
As ANAND_2000V had suggested earlier, one (hopefully only one) of the queries (SELECT ... INTO...) in your form trigger WHEN-VALIDATE-ITEM returns more than one row.
You could add a handling exception in your EXCEPTION block as follow to catch ORA-01422 error

For example,

DECLARE
   DUMMY VARCHAR2(1);

BEGIN
   SELECT CODE
   INTO   DUMMY
   FROM   TBPRJSTATUS
   WHERE  CODE = :B1.STATUS;

EXCEPTION
   WHEN NO_DATA_FOUND
   THEN MESSAGE('Invalid project status');
        RAISE FORM_TRIGGER_FAILURE;
   WHEN TOO_MANY_ROWS
   THEN MESSAGE('Query returns more than one row'); pause;
       -- do whatever you have to do here if more than one row is returned
       RAISE FORM_TRIGGER_FAILURE;
END;
0
 
LVL 13

Accepted Solution

by:
anand_2000v earned 500 total points
ID: 12149490
check  out duplicate codes in the table....remove the additional codes
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question