second rev

implementation was wrongly done by using stored procedure instead.
corrected now.