Execute SQL Query from TI processes
Posted: Wed Apr 13, 2016 3:56 pm
Hello All,
I have following queries in SQL which executes normally and gives desired output:
Select a.Actual,a.Periodyear,a.Monthname,a.Driver, a.TM1_PC_Data_BD6,a.TM1_LOC_Data_BD6,a.TM1_Var_Data_BD6,
b.TM1_PC_Data,b.TM1_LOC_Data,b.TM1_Var_Data,
(a.TM1_PC_Data_BD6-b.TM1_PC_Data) as Var_PC_Cube_BD6_Now,
(a.TM1_LOC_Data_BD6-b.TM1_LOC_Data) as Var_LOC_Cube_BD6_Now,
(a.TM1_Var_Data_BD6-b.TM1_Var_Data) as Var_Var_Cube_BD6_Now
into [dbtm1].[dbo].[BD6_LOCPCVar_Data_Recon]
from [dbtm1].[dbo].[Temp_BD6_LOCPCVAR_Driver_DataValidation] a
Inner Join [dbtm1].[dbo].[Temp_LOCPCVAR_Driver_DataValidation] b
On (a.actual=b.actual and a.periodyear=b.periodyear and a.monthname=b.monthname and a.driver=b.driver);
I copy paste the query into TM1 Prolog tab as follow:
ODBCOPEN();
Vsql=
'Select a.Actual,a.Periodyear,a.Monthname,a.Driver, a.TM1_PC_Data_BD6,a.TM1_LOC_Data_BD6,a.TM1_Var_Data_BD6,
b.TM1_PC_Data,b.TM1_LOC_Data,b.TM1_Var_Data,
(a.TM1_PC_Data_BD6-b.TM1_PC_Data) as Var_PC_Cube_BD6_Now,
(a.TM1_LOC_Data_BD6-b.TM1_LOC_Data) as Var_LOC_Cube_BD6_Now,
(a.TM1_Var_Data_BD6-b.TM1_Var_Data) as Var_Var_Cube_BD6_Now
into [dbtm1].[dbo].[BD6_LOCPCVar_Data_Recon]
from [dbtm1].[dbo].[Temp_BD6_LOCPCVAR_Driver_DataValidation] a
Inner Join [dbtm1].[dbo].[Temp_LOCPCVAR_Driver_DataValidation] b
On (a.actual=b.actual and a.periodyear=b.periodyear and a.monthname=b.monthname and a.driver=b.driver)';
ODBCOutput('development',vSql);
It throws following error:
error Prolog line 228 Sql query "..."
Could anyone please look in to it and throws the light on how to include same query in TI process to run?
I am executing more than 6 Sql scripts from a TI process and they are executing perfectly f9. I just found problem with this sql script which is working f9 in SQL but throws error during TM1 TI process execution
Please feel free if you require further information.
Thank You
I have following queries in SQL which executes normally and gives desired output:
Select a.Actual,a.Periodyear,a.Monthname,a.Driver, a.TM1_PC_Data_BD6,a.TM1_LOC_Data_BD6,a.TM1_Var_Data_BD6,
b.TM1_PC_Data,b.TM1_LOC_Data,b.TM1_Var_Data,
(a.TM1_PC_Data_BD6-b.TM1_PC_Data) as Var_PC_Cube_BD6_Now,
(a.TM1_LOC_Data_BD6-b.TM1_LOC_Data) as Var_LOC_Cube_BD6_Now,
(a.TM1_Var_Data_BD6-b.TM1_Var_Data) as Var_Var_Cube_BD6_Now
into [dbtm1].[dbo].[BD6_LOCPCVar_Data_Recon]
from [dbtm1].[dbo].[Temp_BD6_LOCPCVAR_Driver_DataValidation] a
Inner Join [dbtm1].[dbo].[Temp_LOCPCVAR_Driver_DataValidation] b
On (a.actual=b.actual and a.periodyear=b.periodyear and a.monthname=b.monthname and a.driver=b.driver);
I copy paste the query into TM1 Prolog tab as follow:
ODBCOPEN();
Vsql=
'Select a.Actual,a.Periodyear,a.Monthname,a.Driver, a.TM1_PC_Data_BD6,a.TM1_LOC_Data_BD6,a.TM1_Var_Data_BD6,
b.TM1_PC_Data,b.TM1_LOC_Data,b.TM1_Var_Data,
(a.TM1_PC_Data_BD6-b.TM1_PC_Data) as Var_PC_Cube_BD6_Now,
(a.TM1_LOC_Data_BD6-b.TM1_LOC_Data) as Var_LOC_Cube_BD6_Now,
(a.TM1_Var_Data_BD6-b.TM1_Var_Data) as Var_Var_Cube_BD6_Now
into [dbtm1].[dbo].[BD6_LOCPCVar_Data_Recon]
from [dbtm1].[dbo].[Temp_BD6_LOCPCVAR_Driver_DataValidation] a
Inner Join [dbtm1].[dbo].[Temp_LOCPCVAR_Driver_DataValidation] b
On (a.actual=b.actual and a.periodyear=b.periodyear and a.monthname=b.monthname and a.driver=b.driver)';
ODBCOutput('development',vSql);
It throws following error:
error Prolog line 228 Sql query "..."
Could anyone please look in to it and throws the light on how to include same query in TI process to run?
I am executing more than 6 Sql scripts from a TI process and they are executing perfectly f9. I just found problem with this sql script which is working f9 in SQL but throws error during TM1 TI process execution
Please feel free if you require further information.
Thank You