Unanswered: Changing values in inserting record via triggers
Does anyone of you know how I ca create a trigger to do the following
Table tbs contain 3 columns : total, num_col and alpha_col
I'm doing an insert in table tbs:
insert into tbs (total) values ('111aaa')
Now I want the trigger to split '111aaa' in to parts: An numeric and a characterpart. The trigger should store the numeric part (111) in column num_col. And the characterpart should be stored in alpha_col.
Thanks for your answer.
What I need to do is on a SQL Server.
I'll try and see, if I can modify your suggestion, so it fits into a SQLServer environment. But I can't find a SQLServer thing like Oracles :new.field1. Do you know if theres a way to reference columns in the current record in a SQLServer trigger ?
there must be a way to manipulate the current triggerfields; otherwise its would make less sence to program a trigger.
Perhaps you try it in the MS Server forum. I haven´t got a documentation af that database, but it can´t be to difficult to figure this out ...