Updated the set_layer_sql method

Updated the set_layer_sql method