Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie to triggers

Re: Newbie to triggers

From: <smb_slb_at_my-dejanews.com>
Date: Tue, 18 May 1999 21:58:02 GMT
Message-ID: <7hsnp9$rth$1@nnrp1.deja.com>


In article <7hqtrs$l8r$1_at_nnrp1.deja.com>,   HLNG_at_USA.net wrote:
> I'm new to Oracle, and would like to automate the following via a
trigger
> whenever a record is inserted / updated:
>
> Update po_lines_all
> set item_description = rtrim(item_description)
> where length(item_description) - length(rtrim(item_description)) > 0
;
>
> Can someone advise on the required syntax and steps necessary to
implement?

Here you go. Run this through SQLPlus. Assuming the name of your table is po_lines:

create trigger tI_po_lines
  before insert
  on fu
  for each row
begin
  :new.col1 := rtrim(:new.col1);
end;
/

Don't forget to include the last line with the "/".

In the future, read the following in your Oracle documentation: <your oracle directory>/doc/database.804/a58225/ch4a.htm#1997457

--== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.--- Received on Tue May 18 1999 - 16:58:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US