Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have an OLE DB connection to a database and I have a long list of tables (~40) that I need to load. The table names are stored in an xls spreadsheet. I loaded the table names into QV into a field called 'TableName'. Is there a way for me to loop through and load these tables automatically? I also wrote a script to do the actual load, which I will implement using an include statement.
Thanks!
Liz
Try this
EXCEL:
load * inline [
TableName
one
two
three
];
FOR i=0 to NoOfRows('EXCEL')-1
let t=Peek('TableName', $(i));
trace table to read is $(t);
set st= SELECT * FROM $(t);
trace sql statement is $(st);
$(t):
LOAD *;
SQL
$(st);
NEXT;
Thank you, Maxgro! This worked!
Liz