Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have an issue in loading multiple SQL DB.
First, I'm loading the list of the companies:
SQL SELECT COMP_NAME, LANG
FROM system.dbo.ENVIRONMENT;
The table looks like this:
Company_1, eng
Company_2, spn
Company_3, ger
now I would like to load each company's data which is located in the company's Database (the name of the database is the content of the COMP_NAME i.e, Company_1, Company2_Comapny_3 etc so the name of the Database shoud be Company_1.dbo.'table name').
I will appreciate your help on how to create a loop which will run on the SQL SELECT and will load all the companies data.
Thanks in advanced.
David
I havent had to load from 2 sql's but what about creating a qvd load from one of them ?
Hello David,
You can use 2 connects in the same QVD file.
I already did this:
odbc connect to BASE1
SELECT * FROM TB_REGISTER
ODBC CONNECT TO BASE2
SELECT * FROM TB_REGISTER2
i have helped
Regards,
Ricardo Nepomuceno
Try something like this.
SQL SELECT COMP_NAME, LANG
FROM system.dbo.ENVIRONMENT;
for i = 1 to fieldvaluecount('COMP_NAME')
Let vDatabase = fieldvalue('COMP_NAME',i);
SQL SELECT *
FROM $(vDatabase).dbo.TABLE1;
next