Potresti anche fare una funzione che verifica che il nome della tabella esista realmente nel database.