troubleshooting Question

Oracle Forms question

Avatar of anumoses
anumosesFlag for United States of America asked on
Oracle Database
4 Comments2 Solutions102 ViewsLast Modified:
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;
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros