Page 1 of 1

SQL Query in TI ODBC Connection

Posted: Fri Aug 26, 2011 1:47 am
by xtec2457
I have built an ODBC Connection to a SQL database to source actuals via TI process. I used TIMST to determine the previous month in the SQL table. It gives me the data I need and I can use Chore to run it automatically after work. It works properly but it just takes very long to finsih it as the TI reads every cell within the SQL table (as I use Select * From table in Query section in Data Source tab). Can I write a SQL query in Data Source tab to specify the year I take from the SQL table via ODBC thus reduce the size of the data to be linked to TM1 and increase the speed? If this option is doable, can anyone help me with the SQL query to select the current year? Do I make sense here? Thanks in advance for your help.

Re: SQL Query in TI ODBC Connection

Posted: Fri Aug 26, 2011 2:32 am
by Oratia623
Hi,
Try the following syntax in the SQL:

Code: Select all

SELECT *
FROM tablename
WHERE fieldname = '?variablename?'
Where variablename is either a TI process parameter, or any other variable defined in the prolog tab (in your case via a TIMST function)