Home » Developer & Programmer » Forms » POST-CHANGE Trigger (DS 10g, DB 10g)
POST-CHANGE Trigger [message #435041] Mon, 14 December 2009 00:12 Go to next message
rkgoyal98
Messages: 39
Registered: October 2009
Member

Hello,

I have follwing code on post-change trigger on :currentread item

DECLARE
	V_AMT NUMBER;
	V_CONS NUMBER;
	V_MONTHS NUMBER;
	V_RULE VARCHAR2(2000);
	V_SQL VARCHAR2(2000);
BEGIN
	V_AMT:= 0;
	IF :UPDATEKEY = 'Y' OR :UPDATEKEY IS NULL THEN
		IF :BLK_PRTRQTRELDTL.PREVIOUSREAD IS NOT NULL THEN
			IF :BLK_PRTRQTRELDTL.CURRENTREAD IS NOT NULL THEN
				V_CONS := 0;
				V_MONTHS := (MONTHS_BETWEEN(TO_DATE(TO_CHAR((:TODATE),'RRRRMM'),'RRRRMM'),
						TO_DATE(TO_CHAR(:FROMDATE,'RRRRMM'),'RRRRMM')))+1;
				V_CONS := ROUND((:BLK_PRTRQTRELDTL.CURRENTREAD-:BLK_PRTRQTRELDTL.PREVIOUSREAD)/V_MONTHS,0);
				V_AMT := PRIME.cal_elecamt(:STATE,:BLK_PRTRQTRELMAS.QUARTERTYPE,:FROMDATE,:TODATE,V_MONTHS,V_CONS);
				:CURRENTAMT := V_AMT;
			END IF;
		END IF;
	END IF;
END;	


This code is working fine whenever there is change of :currentread data. However everytime new form is opened it gives an error

FRM - 40735 : post-change trigger raised and unhandled exception ORA-01403.

After clicking okay on the alert box data from the query is populated in the form and it works fine.

Kindly help me in how to avoid this error
Regards

[Updated on: Mon, 14 December 2009 00:31]

Report message to a moderator

Re: POST-CHANGE Trigger [message #435044 is a reply to message #435041] Mon, 14 December 2009 00:16 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
ORA-01403 no data found

Check your code in "PRIME.cal_elecamt".

By
Vamsi
Re: POST-CHANGE Trigger [message #435048 is a reply to message #435041] Mon, 14 December 2009 00:34 Go to previous messageGo to next message
rkgoyal98
Messages: 39
Registered: October 2009
Member

Hello,

I have chacked that and there is no trouble in there. However while studying on the post-change trigger it appears that where on the block execute_query is executed post-change fires. Any solution to that
Regards
Re: POST-CHANGE Trigger [message #435077 is a reply to message #435041] Mon, 14 December 2009 03:51 Go to previous messageGo to next message
cookiemonster
Messages: 12410
Registered: September 2008
Location: Rainy Manchester
Senior Member
I suspect this code should be in WHEN-VALIDATE-ITEM rather than POST-CHANGE.
Re: POST-CHANGE Trigger [message #435983 is a reply to message #435041] Sun, 20 December 2009 14:12 Go to previous message
magnetic
Messages: 324
Registered: January 2003
Senior Member

put for example this in your code

if :SYSTEM.RECORD_STATUS <>'QUERY' then
begin
..
.
.
end;

end if;
Previous Topic: COPY BULIT-IN
Next Topic: Spread Table in Forms 6i
Goto Forum:
  


Current Time: Wed Dec 07 04:38:39 CST 2016

Total time taken to generate the page: 0.12532 seconds