Avatar of anumoses
anumosesFlag 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
Avatar of flow01
flow01
Flag of Netherlands image

" 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
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of anumoses
anumoses
Flag of United States of America image

ASKER

thanks
Oracle Database
Oracle Database

Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.

81K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo