Tuesday, 11 October 2011

ODI Substitution API


Retrieve the name of cuurent ODI user using ODI variable

Hi Guru,


It is possible to Retrieve the name of cuurent ODI user using ODI variable.


Define a variable with the following sql statement in the refreshing tab


select USER_NAME from SNP_SESSION where SES_NO=<%odiRef.getSession()%>


Thanks Guru
Ram Kumar Lanke

Export the current ODI session Number into a file

Hi Guru,


Inorder to write the session number of a running package to a file


Call the ODI API getSession substitution method in a call to OdiOutFile tool..


For example,


OdiOutFile -FILE=c:\sess.txt

<%=odiRef.getSession("SESS_NO")%>



Thanks Guru


Ram kumar Lanke

FRIDAY, 20 MAY 2011

ODI substitution method tags and user strings: collisions between them

Hi Guru,


There may be some cases you might want to use the string <% .


But this is an internal interpretation tag used by ODI.


So if you want to use such strings
use the following way


1. Declare a constant valued ODI variable


2. Then by refreshing it in integration interfaces. the variable must be declared in the package


Thanks Guru
Ram Kumar Lanke

ODI variables in ODI API tools

Hi Gurus,


When ever you are trying to use variable in odi tools 


enclose the odi tool api parameter with double quotes


For example
instead of the following code


OdiFileDelete "-DIR=c:\ram\file" -FILE=#file_name


use the following code


OdiFileDelete "-DIR=c:\ram\file" "-FILE=#file_name"


Thanks Guru
Ram Kumar Lanke

ODI variables can not be used in substitution methods such as getObjectName

Hi guru,


Odi variables can not be used in substitution methods such as getObjectName.


This is because due to the way the ODI source code parser works.


Thanks Guru 
Ram kumar Lanke

ODI work repository name at run time

Hi Guru,


We can retrieve the name of the current work repository at run time.


There is no ODI API allowing this.




The following steps explain how to retrieve the name of the current work repository at run time.


1. In the topology manger define a data server for the current master repository.


2. Define the physical schema and logical schema and associate them to one or more contexts.


3. In designer define an alphanumeric variable 


4. on the refresh tab of teh variable ,


set the logical schema name to what you defined in the step 2 
and write the following sql statement


select REP_NAME
from <%=odiRef.getObjectName("L","SNP_REM_REP","D")%>
where REP_ID=to_number(substr(to_char(<%=odiRef.getSession("SESS_NO")%>,length(to_char(<%=odiRef.getSession("SESS_NO")%>))-2,3))


5. Refresh the variable and use the returned value each time the name of the current work repository is required.




Note:


Each session number is made of two parts
Example: 17001, 18001, 19001


first part is a unique, incremental number of varying length from information contained in the SNP_ID work repository table


Second part (three digits) indicates the work repository internal id ( for id =1 you will retrieve a value of 001)




Thanks Guru
Ram kumar Lanke

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger