Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: What's wrong with this trigger
In <tfggkdbnk1c307_at_beta-news.demon.nl> "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> writes:
>>
>>
>> /*
>> 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?
>>
>>
>rtrim returns a varchar2 (ie the whole string without spaces)
>You are assigning it to a char, so a string of length 1.
>This will work only if only 1 char remains after trimming.
>The l_id is redundant
>:new.brkr_id := rtrim(:new.brkr_id);
>should work.
Ah, stupid of me.
Thanks for the help (again). Received on Wed May 09 2001 - 05:35:45 CDT