made a function that replaces numeric database table references to the table and  specified columns of the row they are refering