Trying to create a large table

Im trying to create a sql table that goes like this.

(“CREATE TABLE IF NOT EXISTS Bloab(‘steam’ TEXT NOT NULL, ‘1’ INTEGER NOT NULL, ‘2’ INTEGER NOT NULL , ‘3’ INTEGER NOT NULL,… goes to like 500, PRIMARY KEY(‘steam’));”)

how can i make a loop to do this instead of doing each one individually?

Thanks

[lua]function CreateQuery()
local str = "CREATE TABLE IF NOT EXISTS Bloab(‘steam’ TEXT NOT NULL, "
for i=1, 500 do
str = str … “’” … i … "’ INTEGER NOT NULL, "
end
str = str … “KEY(‘steam’))”
return str;
end[/lua]

Try that.

[editline]03:08PM[/editline]

This may be slightly faster:

[lua]function CreateQuery()
local tab = {}
table.insert(tab, "CREATE TABLE IF NOT EXISTS Bloab(‘steam’ TEXT NOT NULL, “);
for i=1, 500 do
table.insert(tab, “’”…i…”’ INTEGER NOT NULL, ");
end
table.insert(tab, “KEY(‘steam’))”);
return table.concat(tab);
end[/lua]

What are you doing that needs 500 integers :geno:. Might be a better way.

nah this seems perfect thanks MakeR for ur awesome help.