hi al, i need to write a trigger whicj will remove prepnding zeros froma values before insert or update i need this on urgent basis eg. 000123 should be entered as 123 in the amount colmun of payments table on insert as well as update Can anyone help me with the trigger. THIS IS AN SOS!! thanx in advance Chhaya
The NUMBER data type will ignore all leading zero. If you really have to use varchar, then you can(another solution is to use 'round' function) use 'fm' in the format mask to remove the leading zeros or spaces For eg: zerotest table with two columns (Name varchar2(10),amount varchar2(5)) insert into zerotest values('chhaya',to_char('00234','fm99999'));