Solved

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

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

Question has a verified solution.

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

Suggested Solutions

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

929 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

13 Experts available now in Live!

Get 1:1 Help Now