I have a list of items (contained in a text file list.txt):
//list.txt
item1
...
itemN
I need to create a table in a database for each item:
table_item1
...
table_itemN
I don't want to do it manually, so I'm looking for a way to automate this. Can I somehow pass list.txt into sql-script and then create tables per each item using some SQL-loop statement? Something like this (pseudocode):
// script.sql
FOREACH item
CREATE TABLE table_item
Could you please tell me how can I paramerize SQL command for creating a table? I need an SQL procedure with a parameter:
create_table(String table_title);