ODI work repository name at run time


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) 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.