?
Solved

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

Posted on 2004-09-22
5
Medium Priority
?
16,709 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

762 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