I think you better explain more of the situation. Where do the table names come from? If they are part of hash, what are they associated with (filenames? connections?). What are you going to do with the table names? By hardcoded in the script, do you mean hardcoded in SQL statements? Sorry, there's not much to answer unless you can give us some clues.