Solved

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

Posted on 2004-09-22
5
16,330 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and theā€¦
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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.
Via a live example, show how to take different types of Oracle backups using RMAN.

705 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now