Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can any one help me with sample script to load multiple tables from DB to Qv and the store it into qvds.
Say example , I have tables like,
abc.abc.abc_2017,
abc.abc.abc_2018,
abc.abc.abc_2019.......
Need to load multiple tables and store it into qvds
Regards
PC
Best way to do this is, Create an excel file with all the table names. and use FOR loop in QV script.
TABLE_LIST:
LOAD
TableName
FROM [..\Support\TableList.xlsx]
(ooxml, embedded labels, table is [Table List]);
OLEDB CONNECT TO [...];
FOR EACH file in FieldValueList('TableName')
TABLE_NAME:
SQL SELECT * FROM Abc.dbo.$(file);
STORE TABLE_NAME INTO [..\Qvd\$(file).QVD];
DROP TABLE TABLE_NAME;
NEXT file
DROP TABLE TABLE_LIST;
thank you for quick responce. but is it possible without creating a table. bcz for next year we need to add manually another table to that table.
I need dynamic script without creating table.
Regards
PC
use table name in the from statement as abc_*
Eg:Table_Name
load Fieldname1, fieldname2,.....;
select * from abc_*;
Here all the table names starting with abc will get loaded, but the post suggesting use of excel would probably be a better option to maintain consistency and keep in track of what files you would exactly like to load