Home » Developer & Programmer » Forms » frm 40375 (FORM 6i)
frm 40375 [message #497702] Sun, 06 March 2011 21:40 Go to next message
cyrsprite
Messages: 26
Registered: March 2011
Location: Manila, Philippines
Junior Member

frm-40375: when-validate-item trigger raised unhandled exception ORA-01403.

pls help me. i put a new column which is the birth date and i made a new procedure with regards to the age level for the Plan. and when i run the program, theres an error..

thanks

im just new in programming..
Re: frm 40375 [message #497728 is a reply to message #497702] Mon, 07 March 2011 00:10 Go to previous messageGo to next message
rajesh4851
Messages: 89
Registered: January 2007
Member
what is the query data source for that block? is it table/procedure/from clause query?
Find out where the error is occuring and before to that print :system.last_query value to find out the problem.
Give some more details to address your issue.
Re: frm 40375 [message #497730 is a reply to message #497702] Mon, 07 March 2011 00:13 Go to previous messageGo to next message
Littlefoot
Messages: 21821
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SELECT statement didn't find any records, so trigger raised NO-DATA-FOUND error.

It is difficult to debug code you don't see, so - if possible, post your code. Format it and enclose into [CODE] tags so that it is easier to read. If you are not sure how to do that, check this.
Re: frm 40375 [message #497762 is a reply to message #497730] Mon, 07 March 2011 01:35 Go to previous messageGo to next message
cyrsprite
Messages: 26
Registered: March 2011
Location: Manila, Philippines
Junior Member

they requiring a new column for birth date, then after that, i put a validations referring to the request. there should have age bracket depending on the price so i put this in the key next item instead of doin a procedure

n_months_between := TRUNC(MONTHS_BETWEEN(:txt_received_dt, :txt_ph_birthdate));
n_years := TRUNC(n_months_between / 12);
n_months := n_months_between - (12*n_years);
d_same_day_occur := ADD_MONTHS(:txt_ph_birthdate, n_months_between);
n_days := :txt_received_dt - d_same_day_occur;

if :txt_plan_type = 212 then -- MSB Prime
if :txt_ph_birthdate > sysdate then
set_alert_property('note_alert',title,'Alert');
set_alert_property('note_alert',alert_message_text,'Birthdate is greater than the system date.');
--tv_temp := a_msgbox('ALERT','Birthdate is greater than system date.',1);
raise form_trigger_failure;

elsif ((n_years*10000 + n_months*100 + n_days) > 170600) and ((n_years*10000 + n_months*100 + n_days) > 400529) THEN
set_alert_property('note_alert',title,'Alert');
set_alert_property('note_alert',alert_message_text,'MSB Prime is for Age 40 and Below only.');
--v_temp := a_msgbox('ALERT','MSB Prime is for Age 40 and Below only',1);
raise form_trigger_failure;

else
go_item('txt_term');
end if;

elsif :txt_plan_type = 214 then -- MSB Premium
if :txt_ph_birthdate > sysdate then
set_alert_property('note_alert',title,'Alert');
set_alert_property('note_alert',alert_message_text,'Birthdate is greater than the system date.');
--tv_temp := a_msgbox('ALERT','Birthdate is greater than system date.',1);
raise form_trigger_failure;

elsif ((n_years*10000 + n_months*100 + n_days) > 400600) and ((n_years*10000 + n_months*100 + n_days) > 550529) THEN
set_alert_property('note_alert',title,'Alert');
set_alert_property('note_alert',alert_message_text,'MSB Premium is for Age 41 to 55 only.');
raise form_trigger_failure;
-- v_temp1 := a_msgbox('ALERT','MSB Premium is for Age 41 - 55 only',1);

else
go_item('txt_term');
end if;
end if;

end;

I compiled it and no error but when i run the program..

the save button doesnt work..

i dont know how? is it because i put a command in the pre-next-item and not in a procedure item?
Re: frm 40375 [message #497775 is a reply to message #497762] Mon, 07 March 2011 02:17 Go to previous messageGo to next message
Littlefoot
Messages: 21821
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Code you posted didn't return ORA-01403.

Moreover, this is not a complete code (if nothing else, it doesn't contain DECLARE section).

I asked you to format it and apply [code] tags, but you didn't. Why? PLEASE, format it! It is difficult to read nested IFs if code is not formatted.
Re: frm 40375 [message #497783 is a reply to message #497730] Mon, 07 March 2011 02:46 Go to previous messageGo to next message
cyrsprite
Messages: 26
Registered: March 2011
Location: Manila, Philippines
Junior Member

first the requested to add field in the canvass which is 'Birth Date'.

so i put the field 'txt_ph_birthdate' - for individual

they gave an instruction to put validation in key-next-item where in the validation is based on the age for instance:

Ages 40 and below Ages 41 to 55 Ages 56 and Above

then the my validation on key next item is

declare

	n_months_between   NUMBER;
  d_same_day_occur   DATE;
  n_years            NUMBER;
  n_months           NUMBER;
  n_days             NUMBER;
  v_temp	     NUMBER;
  v_temp1	     number;
  temp_years	     NUMBER:=0;
BEGIN
	
	
  n_months_between := TRUNC(MONTHS_BETWEEN(:txt_received_dt, :txt_ph_birthdate));
  n_years          := TRUNC(n_months_between / 12);
  n_months         := n_months_between - (12*n_years);
  d_same_day_occur := ADD_MONTHS(:txt_ph_birthdate, n_months_between);
  n_days           := :txt_received_dt - d_same_day_occur;


if :txt_plan_type = 212 then     -- MSB Prime
   if :txt_ph_birthdate > sysdate then
   set_alert_property('note_alert',title,'Alert');
   set_alert_property('note_alert',alert_message_text,'Birthdate is greater than the system date.');
raise form_trigger_failure;
  		
elsif ((n_years*10000 + n_months*100 + n_days) > 170600) and ((n_years*10000 + n_months*100 + n_days) > 400529) THEN
  set_alert_property('note_alert',title,'Alert');
  set_alert_property('note_alert',alert_message_text,'MSB Prime is for Age 40 and Below only.');raise form_trigger_failure; 
else
  go_item('txt_term');	
 end if;
 	 
 elsif :txt_plan_type = 214 then  -- MSB Premium
if :txt_ph_birthdate > sysdate then	 	  	 set_alert_property('note_alert',title,'Alert');
 	 	  	set_alert_property('note_alert',alert_message_text,'Birthdate is greater than the system date.');
raise form_trigger_failure;	
 	 	  	
elsif ((n_years*10000 + n_months*100 + n_days) > 400600) and ((n_years*10000 + n_months*100 + n_days) > 550529) THEN
 	 	  		set_alert_property('note_alert',title,'Alert');
  			  set_alert_property('note_alert',alert_message_text,'MSB Premium is for Age 41 to 55 only.');
 raise form_trigger_failure;
 else 
 go_item('txt_term');
 end if;
 end if;
end;



there no error with this but when i run the program i think its not working and it still accept age 17 years old.

do i need to do one procedure body(prgram unit) referring on the checking of age?

thanks a lot




CM: fixed the code tags. They should [code] not <code>

[Updated on: Mon, 07 March 2011 03:22] by Moderator

Report message to a moderator

Re: frm 40375 [message #497791 is a reply to message #497783] Mon, 07 March 2011 03:28 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
1) You still haven't posted the code that gives the no_data_found
2) Validation code should go in when-validate-item, not key-next-item, othewise the user can bypass it by using the mouse.
3) What is this supposed to do:
elsif ((n_years*10000 + n_months*100 + n_days) > 170600) and ((n_years*10000 + n_months*100 + n_days) > 400529) THEN
Re: frm 40375 [message #502226 is a reply to message #497775] Tue, 05 April 2011 06:46 Go to previous messageGo to next message
cyrsprite
Messages: 26
Registered: March 2011
Location: Manila, Philippines
Junior Member

The Problem is how to correct ORA 1403? the scenario is if the contract number is not existing in the database, let the transfer and payment details be encoded
Re: frm 40375 [message #502227 is a reply to message #502226] Tue, 05 April 2011 07:07 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
Catch the exception with an exception handler and then do whatever needs doing.
Re: frm 40375 [message #502229 is a reply to message #502227] Tue, 05 April 2011 07:12 Go to previous messageGo to next message
cyrsprite
Messages: 26
Registered: March 2011
Location: Manila, Philippines
Junior Member

what does is mean?i will delete the exception?
Re: frm 40375 [message #502237 is a reply to message #502229] Tue, 05 April 2011 07:26 Go to previous messageGo to next message
Littlefoot
Messages: 21821
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Exception is part of a PL/SQL block. Check the documentation, there are many examples at the bottom of the page.

As of your second question: it won't "delete" exception, but "handle" it.
Re: frm 40375 [message #502239 is a reply to message #502229] Tue, 05 April 2011 07:27 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
You need to spend some time reading up on PL/SQL. exception handling is a fundamental basic.

BEGIN

  SELECT <columns> INTO <whatever>
  FROM <table>
  WHERE ....

EXCEPTION WHEN NO_DATA_FOUND THEN

  <do whatever needs doing if the data doesn't exist>

END;

[Updated on: Tue, 05 April 2011 08:05] by Moderator

Report message to a moderator

Re: frm 40375 [message #502244 is a reply to message #502239] Tue, 05 April 2011 07:55 Go to previous messageGo to next message
cyrsprite
Messages: 26
Registered: March 2011
Location: Manila, Philippines
Junior Member

begin
  begin
    select cust_plan_pack, cust_is_code, nvl(cust_avail_status,0)
    into    :cust_plan_pack, v_is, :cust_avail_status from customer
    where   cust_contr        = :tran_contr
    and    cust_check_digit = :chk_digit;

  exception                      -- coh07052010
    when   no_data_found then 
      v_is     := null;
  end;


  if :tran_contr is null then
    message('Please enter contract number!',acknowledge);
    message(' ',no_acknowledge);
    set_item_property('tran_contr',visual_attribute,'suspended');
    go_item('tran_contr');
    return;
    
  else
    set_item_property('tran_contr',visual_attribute,'enable');
  end if;
  
  if :chk_digit is null then
    message('Please enter check digit!',acknowledge);
    message(' ',no_acknowledge);
    set_item_property('chk_digit',visual_attribute,'suspended');
    go_item('chk_digit');
    return;

  else
    set_item_property('chk_digit',visual_attribute,'enable');

  end if;


that is the existing code...



CM: fixed the [code] tags and reformatted the code.

[Updated on: Tue, 05 April 2011 08:24] by Moderator

Report message to a moderator

Re: frm 40375 [message #502253 is a reply to message #502244] Tue, 05 April 2011 08:24 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
So you've got an exception handler already, what's the problem?
Re: frm 40375 [message #502304 is a reply to message #502244] Tue, 05 April 2011 13:10 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
cyrsprite wrote on Tue, 05 April 2011 08:55


that is the existing code...



CM: fixed the [code] tags and reformatted the code.


Existing code, but incomplete code once again as there is no matching END tag to your BEGIN tag. Additionally, this code is nothing like the code you previously posted. Why don't you take some time to ask a clear and complete question with examples rather than wait for us to keep asking for you to post things you keep leaving out?
Previous Topic: Solution from populate POPLIST
Next Topic: Change Database Data Block Property at Runtime
Goto Forum:
  


Current Time: Fri Nov 08 15:32:07 CST 2024