We help IT Professionals succeed at work.

Oracle Forms question

anumoses
anumoses asked
on
97 Views
Last Modified: 2018-12-14
Oracle form question

I have 2 new fields added. comment_user and comment_date.

Requirement

when the user enter comments in the vend_change_comments field, I have to populate comment_user as user and comment_date as sysdate.

In the forms pre-update trigger I have this code.. If the old user and old date is not the same as present user and date, the update it to user and sysdate. I have this code, which is not working. Need help

declare
	
	v_old_comment_user    dss.disposition_details.comment_user%TYPE;
	v_old_comment_date    dss.disposition_details.comment_date%TYPE; 
	
	Cursor C1 is
	select comment_user,comment_date
	  from dss.disposition_details
	 where id = :disposition_details.id
	   and action = 'R';
	  
Begin
	Open C1;
	Fetch C1 into v_old_comment_user
	              ,v_old_comment_date;
	Close C1;
	
If v_old_comment_user is null and v_old_comment_date is null then
		:disposition_details.comment_user := user;
	  :disposition_details.comment_date := sysdate;	
Elsif v_old_comment_user != :disposition_details.comment_user then
    	:disposition_details.comment_user:= user; 
ElsIf v_old_comment_date != :disposition_details.comment_date then
    		:disposition_details.comment_date := sysdate;
End if;  
    	
	
End;

Open in new window

Comment
Watch Question

flow01IT-specialist
CERTIFIED EXPERT

Commented:
" is not working " means does not compile,  does compile and gives an error at runtime,  does compile and gives no error but is not updating comment_user.
If the last one is true verify  the trigger fires (put a message after the begin and if it does fire put additional messages with the value of the items that matter to  debug the problem), else give the error message for compile or runtime
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Mark GeerlingsDatabase Administrator
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
thanks