Update SQL Statement inside TI Process

Post Reply
NewtoTm1
Posts: 5
Joined: Fri Dec 09, 2016 4:40 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010

Update SQL Statement inside TI Process

Post by NewtoTm1 »

Hi Everyone,
I am trying to write a sql update statement in a TI process but I keep getting an error 'SET key word missing' and execution is aborted. I have pasted out the part where I am using the update statement. It will be great if anyone could help me out with this.

---------------------------------------------------------------

If (STG_Meeting_Measures @= 'Class Size');

classSize = VValue;

ODBCOutput( 'WLM_STG','update rpt_sample

set class_size = ''%classSize%''

where VYear =''%VvYear%''');

endif;

----------------------------------------------------------------------
Thanks
mvaspal
Community Contributor
Posts: 341
Joined: Wed Nov 03, 2010 9:16 pm
OLAP Product: tm1
Version: 10 2 2 - 2.0.5
Excel Version: From 2007 to 2013
Location: Earth

Re: Update SQL Statement inside TI Process

Post by mvaspal »

what happens if you try this:

Code: Select all


If (STG_Meeting_Measures @= 'Class Size');

classSize = VValue; 
vSQL = 'update rpt_sample set class_size = ' | classSize | ' where VYear = ' | VvYear | ' ;' ;

ODBCOutput( 'WLM_STG',vSQL); 

endif;

mvaspal
Community Contributor
Posts: 341
Joined: Wed Nov 03, 2010 9:16 pm
OLAP Product: tm1
Version: 10 2 2 - 2.0.5
Excel Version: From 2007 to 2013
Location: Earth

Re: Update SQL Statement inside TI Process

Post by mvaspal »

sorry, this may not work as those variables are numeric variables, so you may need to convert it to string
Post Reply