datasource username and password
-
- Posts: 44
- Joined: Mon May 17, 2010 8:14 am
- OLAP Product: tm1 cognos
- Version: 9.5
- Excel Version: 2007
datasource username and password
hi,
i have a requirement like i need to take the username and password of the datasource from a file which has all these details.
i have created a process which reads username and password from this file and i am trying to call those process in my actual process for reading database table i needed...
so i am expecting my username as an output from another process. But i couldnt see any function which outputs a string variable.
this is my prolog coding in the actual process
username=executeprocess(user_pass_read);
DatasourceUserName=username;
DatasourcePassword=Password;
but my logic is not working well,...
kindly tell me where i hve went wrong.
regards
angel
i have a requirement like i need to take the username and password of the datasource from a file which has all these details.
i have created a process which reads username and password from this file and i am trying to call those process in my actual process for reading database table i needed...
so i am expecting my username as an output from another process. But i couldnt see any function which outputs a string variable.
this is my prolog coding in the actual process
username=executeprocess(user_pass_read);
DatasourceUserName=username;
DatasourcePassword=Password;
but my logic is not working well,...
kindly tell me where i hve went wrong.
regards
angel
-
- Site Admin
- Posts: 1454
- Joined: Wed May 28, 2008 9:09 am
Re: datasource username and password
TI procedures aren't functions and thus don't return values. Define a set of global variables and use them to pass the results back.
-
- Posts: 44
- Joined: Mon May 17, 2010 8:14 am
- OLAP Product: tm1 cognos
- Version: 9.5
- Excel Version: 2007
Re: datasource username and password
hi,
this is my prolog coding in actual process.
DataSourceType='ODBC';
DatasourceNameForServer='oracle';
DatasourceNameForClient='oracle';
executeprocess('user_pass_read');
DatasourceUserName=username1;
DatasourcePassword=Password1;
asciioutput('d:\t.txt',username1,',',password1);
DatasourceQuery='select * from ?mytable?';
here i am getting an error that username1 is not defined.
but username1 is a variable (global variable defined in my process user_pass_read)....
prolog coding of user_pass_read
stringglobalvariable('username1');
stringglobalvariable('password1');
username1=username(variable from the text data source in user_pass_read );
password1=password(variable from the text data source in user_pass_read );
can any one check what is the issue?
regards
angel
this is my prolog coding in actual process.
DataSourceType='ODBC';
DatasourceNameForServer='oracle';
DatasourceNameForClient='oracle';
executeprocess('user_pass_read');
DatasourceUserName=username1;
DatasourcePassword=Password1;
asciioutput('d:\t.txt',username1,',',password1);
DatasourceQuery='select * from ?mytable?';
here i am getting an error that username1 is not defined.
but username1 is a variable (global variable defined in my process user_pass_read)....
prolog coding of user_pass_read
stringglobalvariable('username1');
stringglobalvariable('password1');
username1=username(variable from the text data source in user_pass_read );
password1=password(variable from the text data source in user_pass_read );
can any one check what is the issue?
regards
angel
-
- MVP
- Posts: 3120
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.0.9.18
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: datasource username and password
Maybe you could store it in a temporary parameters / administration cube? Could have only 2 dimensions, so a very small and easy cube.
After the process, you erase the values again.
Wim
After the process, you erase the values again.
Wim
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 44
- Joined: Mon May 17, 2010 8:14 am
- OLAP Product: tm1 cognos
- Version: 9.5
- Excel Version: 2007
Re: datasource username and password
hi wim,
i didnt get you.Can you please explain it what your trying to tell,i am a beginner in tm1.
regards,
angel
i didnt get you.Can you please explain it what your trying to tell,i am a beginner in tm1.
regards,
angel
-
- MVP
- Posts: 3120
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.0.9.18
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: datasource username and password
Okay. Here's a possible way.
Create a small cube with only 2 dimensions. Name the cube PARAMS or another name of your liking.
Create 2 dimensions:
PARAMS_Measures
and
Measures
PARAMS_Measures contains n elements 'username' and 'password'
Measures contains n element 'number' and s element 'string'
Create a cube with these dimensions, in this order.
Than, using:
CELLPUTS(theusername,'PARAMS','username','string');
and
CELLPUTS(thepassword,'PARAMS','username','string');
you can temporarily store this information in the cube. Other processes can then just use a CELLGETS:
MyUsername = CELLGETS('PARAMS','username','string');
and
MyPassword = CELLGETS('PARAMS','password','string');
If you needed more detail, add extra dimensions to that temporary cube.
Wim
Create a small cube with only 2 dimensions. Name the cube PARAMS or another name of your liking.
Create 2 dimensions:
PARAMS_Measures
and
Measures
PARAMS_Measures contains n elements 'username' and 'password'
Measures contains n element 'number' and s element 'string'
Create a cube with these dimensions, in this order.
Than, using:
CELLPUTS(theusername,'PARAMS','username','string');
and
CELLPUTS(thepassword,'PARAMS','username','string');
you can temporarily store this information in the cube. Other processes can then just use a CELLGETS:
MyUsername = CELLGETS('PARAMS','username','string');
and
MyPassword = CELLGETS('PARAMS','password','string');
If you needed more detail, add extra dimensions to that temporary cube.
Wim
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 44
- Joined: Mon May 17, 2010 8:14 am
- OLAP Product: tm1 cognos
- Version: 9.5
- Excel Version: 2007
Re: datasource username and password
hi wim ,
Thanku for ur detailed reply .....(i manually created the logic in architect and understood what u have told to me )
i am trying to load the params(like you said) cube from a csv file . what i have done isthat, in that file
i created param column having elements username,password,
then measures columns containing number ,string and a data column containing username1,password1.
my doubt is that is it possible through a turbo process to assign a string in the data point???
{when manually created i got username1 in the datapoint,but when i tried with ti it had end up with some errors}
regards,
Angel
Thanku for ur detailed reply .....(i manually created the logic in architect and understood what u have told to me )
i am trying to load the params(like you said) cube from a csv file . what i have done isthat, in that file
i created param column having elements username,password,
then measures columns containing number ,string and a data column containing username1,password1.
my doubt is that is it possible through a turbo process to assign a string in the data point???
{when manually created i got username1 in the datapoint,but when i tried with ti it had end up with some errors}
regards,
Angel
-
- MVP
- Posts: 3120
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.0.9.18
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: datasource username and password
Hello
To put a number in a cube, use the CELLPUTN function (N at the end for Numeric)
To put a string (text) in a cube, use the CELLPUTS function (S at the end for String)
It's either of the two
You will overwrite any existing contents that are in the cube on the respective cell coordinates.
Wim
PS: Do note that a String (s) cells can also contain numbers (like the number '50'), hence not the number you expect to perform computations on. Indeed, you can't do calculations with it. Or alphanumeric codes like ABC123 schould also be put in a String cell.
To put a number in a cube, use the CELLPUTN function (N at the end for Numeric)
To put a string (text) in a cube, use the CELLPUTS function (S at the end for String)
It's either of the two
You will overwrite any existing contents that are in the cube on the respective cell coordinates.
Wim
PS: Do note that a String (s) cells can also contain numbers (like the number '50'), hence not the number you expect to perform computations on. Indeed, you can't do calculations with it. Or alphanumeric codes like ABC123 schould also be put in a String cell.
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 44
- Joined: Mon May 17, 2010 8:14 am
- OLAP Product: tm1 cognos
- Version: 9.5
- Excel Version: 2007
Re: datasource username and password
hi wim,
i guess u didnt understand my problem. i will write what i have done in the process.
my requirement is to read the username and password for an oracle datasource from a csv file , into a ti process.Using this username and password , the above mentioned process will connect to oracle db which queries some tables for me .......
for that i created a csv file which contains three columns para_measures(having values username,password),measures(having values number,string) and data(username1,password1(which is appeared in the datapoint in ur example)).Then i took , a process called user_pass_read (whose intension is to load paramtest cube with username and password ) whose datasource is the csv file and retrived all three columns in the preview. In the variables tab i got three variables "param measures","measures","data",where i selected
"param measures"(string variable type),"measures" (string variable type)" as element content and data (string variable type)as data content
now i slected the maps tab.....
slected cube tab .... and created a cube "paramtest" cube
in dimension tab
i created two dimensions param_measures (string :elemnt type))and measures( string :elemnt type)dimensions....having element type numeric....
then i ran the process.....The username1(data point is empty) is not getting populated to the cell....
In data tab of advanced tab...
i got an entry like this
#****Begin: Generated Statements***
CellPutS(data,'paramtest',params_measures,measure);
#****End: Generated Statements****
i dono why the data (orginal username) is not getting populated.
could you please help me on that???
regards
angel....
i guess u didnt understand my problem. i will write what i have done in the process.
my requirement is to read the username and password for an oracle datasource from a csv file , into a ti process.Using this username and password , the above mentioned process will connect to oracle db which queries some tables for me .......
for that i created a csv file which contains three columns para_measures(having values username,password),measures(having values number,string) and data(username1,password1(which is appeared in the datapoint in ur example)).Then i took , a process called user_pass_read (whose intension is to load paramtest cube with username and password ) whose datasource is the csv file and retrived all three columns in the preview. In the variables tab i got three variables "param measures","measures","data",where i selected
"param measures"(string variable type),"measures" (string variable type)" as element content and data (string variable type)as data content
now i slected the maps tab.....
slected cube tab .... and created a cube "paramtest" cube
in dimension tab
i created two dimensions param_measures (string :elemnt type))and measures( string :elemnt type)dimensions....having element type numeric....
then i ran the process.....The username1(data point is empty) is not getting populated to the cell....
In data tab of advanced tab...
i got an entry like this
#****Begin: Generated Statements***
CellPutS(data,'paramtest',params_measures,measure);
#****End: Generated Statements****
i dono why the data (orginal username) is not getting populated.
could you please help me on that???
regards
angel....
-
- Posts: 44
- Joined: Mon May 17, 2010 8:14 am
- OLAP Product: tm1 cognos
- Version: 9.5
- Excel Version: 2007
Re: datasource username and password
hi wim,
now its getting populated thank you so much for your wonder ful suggestion :D
regards
angel
now its getting populated thank you so much for your wonder ful suggestion :D
regards
angel
-
- MVP
- Posts: 3120
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.0.9.18
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: datasource username and password
You're welcome, Angel. It's a general trick that is often useful for debugging / temporary storage & retrieval.
Wim
Wim
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly