Solved

Pre-update trigger in oracle forms

Posted on 2004-04-26
2
3,176 Views
Last Modified: 2007-12-19
hi,

In a form i have:

ID      Name
1       Tom
2       Mark
3       Dennis
....     ....

And i have such a situation that someone is updating item "Mark" with id=2 to another name. The new name he writes is "Tom". But the column name must be unique in that table. So i need to write trigger (pre-update i think) that would return back a value "Mark" to a field with ID=2 when user updating that field enters name "Tom" and presses save or cursor leaves the item.
How could i do so?
Thanks
0
Comment
Question by:sky_lt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:Xavi23
ID: 10916585
You can create a unique key in colum 'name'

for example

ALTER TABLE TABLE_NAME
 ADD CONSTRAINT CONSTRAINT_NAME
 UNIQUE (Name)
 ENABLE
 VALIDATE
0
 
LVL 22

Accepted Solution

by:
Helena Marková earned 50 total points
ID: 10916606
I think that you can use DATABASE_VALUE property in a Pre-Update trigger. This trigger fires for each record.

IF Get_Item_Property('your_block.your_item',DATABASE_VALUE)<>:your_block.your_item THEN
  :your_block.your_item :=Get_Item_Property('your_block.your_item',DATABASE_VALUE);
END IF;
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question