Avatar of anumoses
anumoses
Flag for United States of America asked on

Oracle Forms question

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

Oracle Database

Avatar of undefined
Last Comment
anumoses

8/22/2022 - Mon
flow01

" 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
ASKER CERTIFIED SOLUTION
slightwv (䄆 Netminder)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
anumoses

ASKER
thanks
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy