File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes How to write triggers Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Reply Bookmark "How to write triggers" Watch "How to write triggers" New topic
Author

How to write triggers

Chhaya Dhanani
Ranch Hand

Joined: Apr 11, 2001
Posts: 70
hi all,
i am facing problems about writing a trigger.
in fact i dont know how to write one as i am a java programmer. not much knowledge about oracle except for querying
The issue is as foolows
thru a text box in a form, a record is inserted.
The value in the text box is entered as
123-123456789
I want a trigger at this insert which will do the following:
if insert is into TABLE1, it should read the value and remove the hypen from the value and only then insert into TABLE1
that is the value should go as 123123456789
how do i go about doing this?
Thanx in advance
Chhaya
Remar Uy
Ranch Hand

Joined: Mar 18, 2002
Posts: 35
hi,
try this:
create trigger the_trigger_name
before insert on the_table_name
for each row
begin
:new.column := replace(:new.column,'-','');
end;
/
hth.
 
IntelliJ Java IDE
 
subject: How to write triggers
 
Threads others viewed
trigger to check if a row can be inserted or not
How to create dynamic sql?
DAO with Hibernate(multiple datasources)
Trigers in oracle
getting at DOM/stylesheet variable values
developer file tools