?
Solved

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

Posted on 2004-09-22
5
Medium Priority
?
16,803 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 2000 total points
ID: 12149490
check  out duplicate codes in the table....remove the additional codes
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

650 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