Set ODBO Datasource in Prolog
Posted: Fri Mar 17, 2017 3:46 pm
Hello everyone!
IBM Cognos TM1 Build Number: 10.2.20603.106
OS: Windows Server 2012 R2 Standart
We have several servers. On each server (OS - the same) there are several different Cognos models (TM1 Version - the same).
There is a need to transfer data from one server to another and from another model.
The customer insists on using ODBO-connection.
When loading with ODBO, we need to use the MDX-Query.
For example.
#----------------#
Source1:
ODBO Provider - IBM Cognos TM1 OLE DB MD Provider
ODBO Datasource - ServerName1
ODBO Catalog - ModelName1
ODBO UserID - User1
ODBO Password - Password1
MDXQuery1
Source2:
ODBO Provider - IBM Cognos TM1 OLE DB MD Provider
ODBO Datasource - ServerName2
ODBO Catalog - ModelName1
ODBO UserID - User1
ODBO Password - Password1
MDXQuery1
Target:
ServerName3
ModelName3
There is a server ServerName3 and model ModelName3.
We need to transfer data from ServerName1 and ModelName1.
We write the TI process and use the ODBO-connection as the source.
We select MDX-Query and write a query.
At some point, the customer changes the server (the model in this example is not necessary).
Now, as a source, we need to use ServerName2.
We have many TI-processes, like this.
Therefore, we would like to change the name of the server in one place so that the name of the server changes to the new one in all TI-processes at once.
#----------------#
Based on the situation above, the question is:
Is it possible to set the ODBO Datasource in the Prolog of the TI-Process?
After a short investigation, it became clear that:
- I did not find a special local variable for the possibility to set ODBO Datasource;
- You can set a subset (DataSourceODBOHierarchyName) and a cube (DataSourceODBOCubeName), but there is no separate local variable for MDX-Query (for example, it could be called DataSourceODBOQuery). This is another additional question;
# Local variable DatasourceQuery, as it seems to me, should not work here.
- You can set ODBO Catalog using the local variable DataSourceODBOCatalog.
This idea arose because for other sources for TI-processes, it is possible to set the types and source names in the Prolog tab.
For example, when we specify, as a source, the view of a cube, then we can use local variables in Prolog of TI-process.
For example.
DataSourceType = 'VIEW';
DatasourceNameForServer = sSrcCube;
DatasourceNameForClient = sSrcCube;
DatasourceCubeView = sView_Sub;
For information.
Link to local variables:
https://www.ibm.com/support/knowledgece ... les_N80019
P.S.
There was an attempt to write Prolog, but it ended, as expected, unsuccessfully:
DataSourceType = 'OLEDBOLAP';
DataSourceODBOProvider = 'IBM Cognos TM1 OLE DB MD Provider';
DataSourceODBOLocation = '';
DatasourceNameForServer = 'ServerName2';
DatasourceNameForClient = 'ServerName2';
DataSourceODBOCatalog = 'ModelName1';
DatasourceUsername = 'User1';
DatasourcePassword = 'Password1';
DatasourceQuery = 'SELECT <...> ';
In the end, there was an error:
Error: Prolog procedure line (0): Unable to open data source 'ServerName2'.
In this case, if you use the standard functionality, everything works (that is, ServerName2 and ModelName1 are available).
The alternative - to do replace in files * .pro and restart the model.
Thank you!
--
Best regards,
Dmitry
IBM Cognos TM1 Build Number: 10.2.20603.106
OS: Windows Server 2012 R2 Standart
We have several servers. On each server (OS - the same) there are several different Cognos models (TM1 Version - the same).
There is a need to transfer data from one server to another and from another model.
The customer insists on using ODBO-connection.
When loading with ODBO, we need to use the MDX-Query.
For example.
#----------------#
Source1:
ODBO Provider - IBM Cognos TM1 OLE DB MD Provider
ODBO Datasource - ServerName1
ODBO Catalog - ModelName1
ODBO UserID - User1
ODBO Password - Password1
MDXQuery1
Source2:
ODBO Provider - IBM Cognos TM1 OLE DB MD Provider
ODBO Datasource - ServerName2
ODBO Catalog - ModelName1
ODBO UserID - User1
ODBO Password - Password1
MDXQuery1
Target:
ServerName3
ModelName3
There is a server ServerName3 and model ModelName3.
We need to transfer data from ServerName1 and ModelName1.
We write the TI process and use the ODBO-connection as the source.
We select MDX-Query and write a query.
At some point, the customer changes the server (the model in this example is not necessary).
Now, as a source, we need to use ServerName2.
We have many TI-processes, like this.
Therefore, we would like to change the name of the server in one place so that the name of the server changes to the new one in all TI-processes at once.
#----------------#
Based on the situation above, the question is:
Is it possible to set the ODBO Datasource in the Prolog of the TI-Process?
After a short investigation, it became clear that:
- I did not find a special local variable for the possibility to set ODBO Datasource;
- You can set a subset (DataSourceODBOHierarchyName) and a cube (DataSourceODBOCubeName), but there is no separate local variable for MDX-Query (for example, it could be called DataSourceODBOQuery). This is another additional question;
# Local variable DatasourceQuery, as it seems to me, should not work here.
- You can set ODBO Catalog using the local variable DataSourceODBOCatalog.
This idea arose because for other sources for TI-processes, it is possible to set the types and source names in the Prolog tab.
For example, when we specify, as a source, the view of a cube, then we can use local variables in Prolog of TI-process.
For example.
DataSourceType = 'VIEW';
DatasourceNameForServer = sSrcCube;
DatasourceNameForClient = sSrcCube;
DatasourceCubeView = sView_Sub;
For information.
Link to local variables:
https://www.ibm.com/support/knowledgece ... les_N80019
P.S.
There was an attempt to write Prolog, but it ended, as expected, unsuccessfully:
DataSourceType = 'OLEDBOLAP';
DataSourceODBOProvider = 'IBM Cognos TM1 OLE DB MD Provider';
DataSourceODBOLocation = '';
DatasourceNameForServer = 'ServerName2';
DatasourceNameForClient = 'ServerName2';
DataSourceODBOCatalog = 'ModelName1';
DatasourceUsername = 'User1';
DatasourcePassword = 'Password1';
DatasourceQuery = 'SELECT <...> ';
In the end, there was an error:
Error: Prolog procedure line (0): Unable to open data source 'ServerName2'.
In this case, if you use the standard functionality, everything works (that is, ServerName2 and ModelName1 are available).
The alternative - to do replace in files * .pro and restart the model.
Thank you!
--
Best regards,
Dmitry