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

Home -> Community -> Usenet -> c.d.o.server -> Re: What's wrong with this trigger

Re: What's wrong with this trigger

From: Aparna <bliss_is_ignorance_at_hotmail.com>
Date: Sun, 13 May 2001 17:10:39 +0800
Message-ID: <3afe504e.0@news.tm.net.my>

hi stan,

u've missed the ; (semi-colon) after the statement

l_id := rtrim(:new.BRKR_ID,' ')

although this is not an error, it's not necessary to specify the ' ' (i.e. white space within quotes) in the rtrim function... by default rtrim () and ltrim () trim spaces on right and left respectively....

hope this helps...

regards,
aparna

"Patrick Sinke" <patrick.sinke_at_capgemini.nl> wrote in message news:989396340.96495_at_sleeper.capgemini.nl...
> Sybrand is right!
> Note that char is not really supported by Oracle. It is there for
> compatabilty with other versions (why does it still exist in v8 anayway?).
> So always use varchar2.
> I found out that it can be handy in some interfaces with legacy systems to
> use the char datatype, but I still prefer to use varchar2 and rpad it if
> really necessary.
>
> regards,
>
> Patrick Sinke
> Cap Gemini Ernst & Young, sector Financial Services
>
> Stan Brown <stanb_at_panix.com> schreef in berichtnieuws
> 9d9eve$7sd$1_at_panix2.panix.com...
> > I'm trying to troubleshhot a problem created when I upgraded a third
 party
> > application that logs data inot Oracle.
> >
> > My present working theory is thta the app is pading it's text fields
 with
> > spaces. In order to test this theory, I am trying to create a trigger
 that
> > will strip of all trailing spcase. The text fileds that I am puting in
> > should contain no spaces at all. So I have created the following
 trigger:
> >
> >
> >
> > /*
> > Create Triger For MWH_LOG */
> > create or replace trigger MWH_LOG_trig
> > before insert on MWH_LOG for each row
> > declare
> > l_id char;
> > begin
> > l_id := rtrim(:new.BRKR_ID,' ')
> > :new.BRKR_ID := l_id;
> > end;
> > /
> >
> > But, I cna't get Oracle (7.3.4) to accept it. The table MWH_LOG does
> > conatin a column named BRKR_ID, so what stupid mistake am I making here?
> >
> >
>
>
Received on Sun May 13 2001 - 04:10:39 CDT

Original text of this message

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