Page 1 of 1

Parameters in SQL with TI

Posted: Wed Nov 06, 2013 5:58 pm
by tkingcka
I have been attempting to set up a parameter in SQL with TI via ODBC connectivity. The process was pulling data yesterday evening and the parameter was working fine. I came in this morning and no data is available. I am using to data fields from the ODBC pull: FY_CD and PD_NO. In the where clause I was originally using 2013 and 8, which worked then and still currently works. I replaced the 2013 with '?FY_CD?' abd 8 with '?PD_NO?' because both are strings. Now I have no data and don't understand what could have happened. I have attached copies of the ODBC query and the variables tab for your review. Thanks for any assistance.

Re: Parameters in SQL with TI

Posted: Wed Nov 06, 2013 8:40 pm
by tomok
Are pFY_CD and pPD_NO defined as strings in your Parameters tab?

Re: Parameters in SQL with TI

Posted: Wed Nov 06, 2013 11:02 pm
by EvgenyT
try nesting FY_CD and PD_NO into STR in SQL i.e. STR(FY_CD) as ....
and yes what's your variable type? string?

Usually solves that issue for me.

my 2C :)

P.s. look at this thread:

http://www.tm1forum.com/viewtopic.php?f=3&t=9383

ET

Re: Parameters in SQL with TI

Posted: Thu Nov 07, 2013 1:34 pm
by tkingcka
Issue resolved by saving the parameters first and then going back and changing the Sql code to reflect the new parameter fields. Thanks for your assistance. I did not realize there was an order of precedence required.

Re: Parameters in SQL with TI

Posted: Thu Nov 07, 2013 2:30 pm
by tomok
tkingcka wrote:I did not realize there was an order of precedence required.
There isn't. You just defined the parameters incorrectly the first time and didn't know it. When you did it again you fixed your error. You probably left the parameters as values (this is the default setting you get when creating a new parameter) instead of defining them as strings. This is the only way the TI code would save without syntax errors, while at the same time resulting in 0 rows returned when executed.