replace all table references with constant