Re: sql*Loader & DB trigger problem.

From: <Solomon.Yakobson_at_entex.com>
Date: 1997/02/21
Message-ID: <856535943.11761_at_dejanews.com>#1/1


You are inserting a new row. Therefore :OLD is always NULL. Change it to :NEW and you will be OK.

Solomon.Yakobson_at_entex.com

In article <5ej28p$7o9_at_lantana.singnet.com.sg>,   engsys_at_merlion.singnet.com.sg () wrote:
>
> Hello there,
>
> Let me explain my problem,
> I have a table which i am loading from a flat file.
> there is a field to be populated based on the values of another field
> being loaded. i thought i can use db trigger.
>
> so i have created a trigger
>
> create or replace trigger load_tab before insert on my_table
> for each row
> begin
> if old.field1 = 'VALUE1' THEN
> new.field2 := 'ONEVALUE';
> else
> new.field2 := 'OTHERS';
> end if;
> end;
>
> but unfortunately, i see the field2 always has OTHERS, irrespective of
> field1. Can someone help me as where I am doing the mistake.
>
> Thanks in advance.
>
> with regards,
> prasad.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Fri Feb 21 1997 - 00:00:00 CET

Original text of this message