Home » Developer & Programmer » Forms » Pls Find the ERROR in this (oracle9i,xp)
Pls Find the ERROR in this [message #388237] Tue, 24 February 2009 00:01 Go to next message
venkatesh.M.P
Messages: 37
Registered: February 2009
Location: india
Member
PROCEDURE BeforeCommitProc IS
LvNo  Char(10);
LvANo Number(2);
BEGIN
  IF :Control.ModeFlag IN ('Delete','Query') THEN
     RETURN;
  END IF;
  IF :Control.ModeFlag = 'Add' THEN
     :Master.CreateBy := :Global.UserId;
     :Master.CreateDt := SysDate;
     If Nvl(:Control.ModeList,'N') = 'Amend' Then
       Select Max(SlANo) Into LvANo
         From FAFIXEDDEPOSITSM
        Where SlNo = :Master.SlNo_M;
        :Master.SlANo := LvANo + 1;
        
             
       Update FAFIXEDDEPOSITSM
          Set DEPOSITYPE = 'R'
        Where SlNo = :Global.SlNo
          And SlANo = :Global.SlANo;
          
         
          
     Else
    LvNo :='001';-- NOGENERATION('10','01','S','CLR',:Master.DEPOSITDT_M);
     :MASTER.SlNo_M :=  LvNo;
      
      
     End If;
  ELSIF :Control.ModeFlag = 'Modify' THEN
     :Master.ModifyBy := :Global.UserId;
     :Master.ModifyDt := SysDate;
     
      
  END IF;
END;


[EDITED by LF: applied [code] tags]

[Updated on: Tue, 24 February 2009 00:06] by Moderator

Report message to a moderator

Re: Pls Find the ERROR in this [message #388238 is a reply to message #388237] Tue, 24 February 2009 00:09 Go to previous messageGo to next message
Littlefoot
Messages: 21821
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You must be joking!

What error, for heaven's sake?!? I'm not sure whether someone fooled you, but this is an Oracle forum, not a quiz.

If there's an error in this piece of code, what error exactly are you talking about?
Is there any Oracle error message - if so, which one?
Does your code not do what it is supposed to - if so, what would its purpose be?

Until you provide some meaningful information, this code is perfectly OK (as far as I'm concerned).
Re: Pls Find the ERROR in this [message #388243 is a reply to message #388238] Tue, 24 February 2009 00:29 Go to previous messageGo to next message
venkatesh.M.P
Messages: 37
Registered: February 2009
Location: india
Member
no sir as there is nogeneration in that code i am hideing that sentence of code and manual giveing '001' so that some values are not posting and so i am getting error-01403 when i am renwaling any existing Record.
Re: Pls Find the ERROR in this [message #388246 is a reply to message #388243] Tue, 24 February 2009 00:35 Go to previous messageGo to next message
Littlefoot
Messages: 21821
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
ORA-01403 is the "no data found" error. Your SELECT statement raises it so - make sure that it either returns "something" (but it should be exactly one value (otherwise you'll get the "too many rows" error), or - if it is really possible that it might not return a value, create an exception handler section and, well ... handle the exception.
Re: Pls Find the ERROR in this [message #388249 is a reply to message #388237] Tue, 24 February 2009 00:42 Go to previous messageGo to next message
venkatesh.M.P
Messages: 37
Registered: February 2009
Location: india
Member
BEGIN
:Master.SlNo_M := :Global.SlNo;
:Master.SlANo_M := :Global.SlANo;
Begin
Select EntryDt,BANKCD,DEPOSITDT,FDRNO,DEPOSITAMT,RATEOFINTEREST,MATURITYDT,
DURATION,INTAMT,TDS,NETINT,TOTAMT,DEPOSITCD,REASONCD,REMARKS
Into :Master.ENTRYDT_M,:Master.BANKCD_M,:Master.DEPOSITDT_M,:Master.FDRNO_M,
:Master.DEPOSITAMT_M,:Master.RATEOFINTEREST_M,:Master.MATURITYDT_M,:Master.DURATION_M,
:Master.INTAMT_M,:Master.TDS_M,:Master.NETINT_M,:Master.TOTAMT_M,:Master.DEPOSITCD_M,:Master.REASONCD_M,:Master.REMARKS_M
From FAFIXEDDEPOSITSM
Where SlNo = :Global.SlNo
And SlANo = :Global.SlANo ;
EXCEPTION
WHEN NO_DATA_FOUND THEN

Set_Alert_Property('ItemErrMesg',ALERT_MESSAGE_TEXT, 'AfterAmendEntry MISSING..');
If Show_Alert('ItemErrMesg') IS NOT NULL Then
Null;
End If;
BEGIN
SELECT BANKNAME
INTO :MASTER.BANKCDDESC
FROM PMBANKMASTER
WHERE BANKCD = RPAD(:MASTER.BANKCD,3);
EXCEPTION
WHEN NO_DATA_FOUND THEN
Null;
END;
BEGIN
SELECT DEPOSITTYPE
INTO :MASTER.DEPOSITDESC
FROM FADEPOSITTYPEM
WHERE DEPOSITCD = RPAD(:MASTER.DEPOSITCD_M,4);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;
BEGIN
SELECT REASON
INTO :MASTER.REASONDESC
FROM FAREASONM
WHERE REASONCD = RPAD(:MASTER.REASONCD,4);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;

End;
END;



this is my select statement which i posted in afteramend(programe unit) which is showing error when i press F-10 for amend and also when i am pressing F-3 for entry screen and entering data in it and saving it is not showing error.Only With AFTERAMEND(Programe Unit) it is related with beforecommitproc(procedure) which i posted before pls help me sir
Re: Pls Find the ERROR in this [message #388250 is a reply to message #388237] Tue, 24 February 2009 00:45 Go to previous messageGo to next message
venkatesh.M.P
Messages: 37
Registered: February 2009
Location: india
Member
My table structures are as below

CREATE TABLE FAFIXEDDEPOSITSM
(
SLNO CHAR(10),
SLANO CHAR(2) ,
ENTRYDT DATE ,
BANKCD CHAR(3) ,
DEPOSITDT DATE ,
FDRNO VARCHAR2(20),
DEPOSITAMT NUMBER(15,2) ,
RATEOFINTEREST NUMBER(4,2) ,
MATURITYDT DATE,
DURATION VARCHAR2(10),
INTAMT NUMBER(9,2) ,
TDS NUMBER(9,2),
NETINT NUMBER(15,2),
TOTAMT NUMBER(15,2),
DEPOSITCD CHAR(4),
REASONCD CHAR(4),
REMARKS VARCHAR2(100),
Depositype CHAR(1),----- list item (deposit,withdrawal,renewal)
CREATEBY CHAR(10),
CREATEDT DATE,
MODIFYBY CHAR(10),
MODIFYDT DATE
)
/
Alter Table FAFIXEDDEPOSITSM
Add Constraint Pk_FaFixeddepositsM Primary Key (Slno,SLANO )
/
Alter Table FAFIXEDDEPOSITSM
Add Constraint Fk_FAFIXEDDEPOSITSM_REASONCD Foreign Key(REASONCD)
References FaReasonM(REASONCD)
/
Alter Table FAFIXEDDEPOSITSM
Add Constraint Fk_FAFIXEDDEPOSITSM_DEPOSITCD Foreign Key(DEPOSITcd)
References FADEPOSITTYPEM(DEPOSITcd)
/
Create FaReasonM(
REASONCD CHAR(4) NOT NULL,
REASON VARCHAR2(60) NOT NULL,
CREATEBY VARCHAR2(10) NOT NULL,
CREATEDT DATE NOT NULL,
MODIFYBY VARCHAR2(10) NOT NULL,
MODIFYDT DATE NOT NULL
)
/
Alter Table FaReasonM
Add Constraint Pk_FaReasonM Primary Key (REASONCD)
/
create table FADEPOSITTYPEM(
COMPANYCD CHAR(2)
DEPOSITCD char(4) ,
DEPOSITTYPE varchar2(60) NOT NULL,
CREATEBY VARCHAR2(10) NOT NULL,
CREATEDT DATE NOT NULL,
MODIFYBY VARCHAR2(10) NOT NULL,
MODIFYDT DATE NOT NULL
)
/
ALTER TABLE FADEPOSITTYPEM
Add Constraint Pk_FADEPOSITTYPEM Primary Key (DEPOSITCD)
/
Re: Pls Find the ERROR in this [message #388704 is a reply to message #388250] Wed, 25 February 2009 23:52 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Place 'message;pause;' pairs between each statement in your triggers and tell us exactly which statement is failing.

David
Previous Topic: HOW DO I INSERT A HYPERLINK IN AN ORACLE FORM?!
Next Topic: Internal server error
Goto Forum:
  


Current Time: Mon Nov 04 11:22:47 CST 2024