Page 1 of 1

Update SQL Statement inside TI Process

Posted: Tue Jan 17, 2017 11:31 am
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

Re: Update SQL Statement inside TI Process

Posted: Tue Jan 17, 2017 1:08 pm
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;


Re: Update SQL Statement inside TI Process

Posted: Tue Jan 17, 2017 1:49 pm
by mvaspal
sorry, this may not work as those variables are numeric variables, so you may need to convert it to string