How to refresh ODI variable as part of a Knowledge Module?
Hi,
I want to know how can i refresh a ODI varaible in a knowledge module using oracle Technology. EX: i have created a variable called VAR_TEST in ODI.
In one of the knowledge module steps, i want to refresh as mentioned below:
begin
select colname into #VAR_TEST from tablename;
end;
Many thanks ....
Hi Martin,
Put the query in the refresh tab into the variable, generate a scenario from the variable and call the scenario thru "OdiStartScen" (Sunopsis API technology) from KM.
In this case the variable needs to be "Last Value"
An alternative is to use a Java variable instead.... Works better to KM's.
Does it help you?
Cezar Santos
http://odiexperts.com
Similar Messages
-
How to refresh ODI variables from file
Hi,
I followed the fillowing links to implement the dynamic file parameter passing in to the resource name of a datastore.
part-1. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value
part-2. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%e2%80%93-part-2-%e2%80%93-getting-all-lines-once-at-time
For me first part is working fine where as in second part i made canvas looks like
Vlinevariable(refreshing variable)------------------dyanamicfile(refereshing variable)--------------------- interface.
Interface looks like Flatfile to db ,km's are lkm file------sql and ikm is sql incremental update
Vlinevariable is working fine where i am getting numbers in sequence manner to assign in to code of dynamicfile variable and in dynamicfile is not taking that value in to that code and causing session failed.
The code which i put in a refreshing code of dynamicfile is followed below
select samplefile1_csv C1_SAMPLEFILE1_CSV
from TABLE
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=code_generationSNP$CRLOAD_FILE=C:\file/my_test_file.txtSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=samplefile1_csvSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
For the firstrow the number has to get from vlinevariable where in my case not working .
In session while loading the interface (load data) i am getting error like
message-------------- ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection file_tgt.
Caused By: java.sql.SQLException: File not found: C:\file/
at com.sunopsis.jdbc.driver.file.FileResultSet.<init>(FileResultSet.java:160)
at com.sunopsis.jdbc.driver.file.impl.commands.CommandSelect.execute(CommandSelect.java:57)
at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeQuery(FilePreparedStatement.java:131)
at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java:602)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeQuery(SnpSessTaskSql.java:3078)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java:571)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2815)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:619)
source code is select a C1_A,
b C2_B
from TABLE
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=sample1SNP$CRLOAD_FILE=C:\file/#PROJECT1.FILENAMESNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x002cSNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=aSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=bSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=2SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
target code insert into STAGING.C$_0SAMPLE1
C1_A,
C2_B
values
:C1_A,
:C2_B
KIndly help me and thanks in advance.ODI is complaning it cannot locate the file. Try replacing the '/' character with a '\' after file in the designated filepath.
-
How to Refresh a Variable screen in Webtemplet
Hi Experts,
When i execute a WEB Templet giving Variable Selection Inputs , the Variable input values gets stored in the Variable Tab and will not change untill i Change it.
Example
Variable input 0PLANT 5030(this 5030 is the input where i give in the variable selection screen)
when i click back on the intrenet Explorer , this 5030 will be there stored in the 0PLANT tab.
can any one give me solution how can i refresh the variable screen in the WAD
Santosh NagarajThis should solve your problem :
Variable Refresh button in WAD -
How to use ODI Variables in Jython
Hi, im doing a dynamic interfaz .. so i make a connection to bd.
When i try to do it .. i got an error...
How can i access to the odi variables from odi..
this is my code ..
<%
import java.sql.*;
import java.io.*;
BufferedWriter bw = new BufferedWriter(new FileWriter("c:\log.txt"));
StringBuilder strB = new StringBuilder();
Class.forName("oracle.jdbc.driver.OracleDriver");
String ip = "#PROJECT.IP";
String url = "jdbc:oracle:thin:@"+ip+":1521:orcl";
Connection con = DriverManager.getConnection(url,"snpw","admin");
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
bw.write(" raise(' ");
out.print(" raise(' ");
String str = "SELECT c.var_name,d.project_name FROM snp_package a JOIN snp_step b On (a.i_package = b.i_package) JOIN snp_var c ON (b.i_var = c.i_var) JOIN snp_project d ON (c.i_project = d.i_project) WHERE UPPER(pack_name) = upper('DebugJava')";
ResultSet rs = stmt.executeQuery(str);
while(rs.next()){
String var_name = rs.getString("var_name");
String project_name = rs.getString("project_name");
out.print(var_name+" #" project_name"."+var_name+"\n ");
bw.write("#STUFF."+var_name);
bw.write("')");
out.print("')");
rs.close();
bw.close();
stmt.close();
con.close();
%>
this is the error ...:
The application script threw an exception: java.sql.SQLException: Excepción de E/S: The Network Adapter could not establish the connection BSF info: DebugVariables at line: 0 column: columnNo
Iknow tha is taking "#PROJECT.IP" like my ip .. but there is a variable that is on my package with a assiged value 127.0.0.1
but jython is not taking it !!
I make a raise to the variable .. and yes the variable take de value "127.0.0.1" but not in my jython code
note: My variable is linked with OK to the jython procedure on my package
Can i acces to the variable? from jython how?.
Thanks in advanced!!
Edited by: user11334562 on 28-abr-2010 15:121. This is not a jython code, this is beanshell code. Anything you put between <% and %> is beanshell code which is sort of a parser code for ODI. Check out
http://www.beanshell.org/
2. Your expression for "url" variable is wrong. If you want to concatenate strings, you have to use + sign i.e it should be:
String url = "jdbc:oracle:thin:@"+ip+":1521:orcl";
Other statments need to be adjusted similar way.
3. Why would you want to go through so many trouble? Just extract the SQL into a file using ODI SQLUnload tool. The sql should be:
SELECT c.var_name||' #'||d.project_name||'.'||c.var_name FROM snp_package a JOIN snp_step b On (a.i_package = b.i_package) JOIN snp_var c ON (b.i_var = c.i_var) JOIN snp_project d ON (c.i_project = d.i_project) WHERE UPPER(pack_name) = upper('DebugJava')
4. How does printing a set of variables from a particular package help you to write dynamic interface? -
How to use odi variable in java code.
Hi,
I am trying to calculate check sum of a file and need to capture that in a odi variable...
I wrote code like this(selected technology as java bean shell)
<@
import java.io.*;
import java.util.zip.*;
public class checksum {
public static void main(String[] args) throws Exception {
FileInputStream fis = new FileInputStream(new File("c:/dummy.txt"));
CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
BufferedInputStream in = new BufferedInputStream(cis);
while (in.read() != -1) {
#checksum = cis.getChecksum().getValue();
}@>
But I am not able to get that value...
I tried in another way like this
<@
import java.io.*;
import java.util.zip.*;
public class checksum {
public static void main(String[] args) throws Exception {
long result;
FileInputStream fis = new FileInputStream(new File("c:/dummy.txt"));
CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
BufferedInputStream in = new BufferedInputStream(cis);
while (in.read() != -1) {
result= cis.getChecksum().getValue();
@>
In odi variable refreshing mode i selected schema as memory_engine and wrote
select '<@=result@>' from dual;
even this wont work for me :(
Anyone pls help me in this...
Thanks in advance
PavanHi Phani,
Thanks for the reply. I resolved this. The mistake is I wrote java code in a class,in main function. I removed class and main function. Now I am able to capture value into Odi variable...
I modified code as
<@
import java.io.*;
import java.util.zip.*;
long result;
FileInputStream fis = new FileInputStream(new File("C:/dummy.txt"));
CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
BufferedInputStream in = new BufferedInputStream(cis);
while (in.read() != -1) {
result=cis.getChecksum().getValue();
@>
finally retrieving result value from dual
select '<@=result@> from dual
Edited by: 908443 on Jan 16, 2012 10:42 PM -
Refreshing ODI Variable through startscen.bat
Hi,
I am trying to refresh an ODI variable using startscen.bat Batch file.. I need be sending the variable value through cmd so that ODI variable gets refreshed with input value..
Can you please give me the syntax for the same.
ThanksLet me explain my scenerio:
I have a variable defined in ODI as "SCEN_TEST" This variable needs to be refreshed from a csv file present on a my local machine.
Say the csv file has a single column and multiple rows in it:
CSV File:
TEST1
TEST2
TEST3
I have created a batch file ..
I have a CMD command in batch file which creates a for loop which will pick up each row from the csv file.
When the for loop starts in cmd it will pick up TEST1 on its first run , TEST2 on its second etc..
So i need to refresh the ODI variable with TEST1 during first instance , TEST2 during second run etc.
So i am calling the scenerio of the variable using startscen.bat <<scen_name>> <<version>> <<context>>
Now my problem is i need to refresh the ODI variable by the value "TEST1" "TEST2" during consecutive runs..
(Note : I am not inputting the variable value using startscen.bat but i need to refresh the ODI variable by calling variable scenerio)
Thanks -
How to refresh a variable in a procedure
Can I refresh a variable in a procedure so the variable can be used in a next step in the package?
ThanksHi,
Create a package with the variable in refresh mode, create a scenario from it and call it from procedure step.
Does it help you? -
How to refresh Report viewer web part programatically using C# in SharePoint?
I have used Report viewer web part in SharePoint page, I want to refresh it programmatically. How can I achieve this? I have tried approach mentioned on
http://nicholasfaiello.wordpress.com/2012/12/28/report-viewer-web-part-programmatically-refresh-a-report/ site, but it is not working.Hi,
How about using JavaScript to perform page reloaded or just trigger the click event of the refresh button with the Report View Web Part? It could be seen as a kind of workaround
for auto refreshing.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/b0b6d11d-07c8-4b4d-bd69-ec60e85e0678/sharepoint-report-viewer-web-part-parameter-issue-not-refreshing?forum=sharepointgeneralprevious
http://richmintzbi.wordpress.com/2011/06/21/auto-refresh-ssrs-reports-part-ii/
Best regards
Patrick Liang
TechNet Community Support -
How to refresh the variable in BPEL
Hi everybody,
Can anyone give me any idea, how a variable can be refreshed in BPEL. Sometimes, perhaps, it retains the old value and thats why new value is not being reflected.
Thanks in advance.
Chandrachur.Hi Matej,
Thanks for your reply. Could you please refer to the question(subject line: *'Facing problem while catching the return output from webservice'*) which I posted today. There I have summarised my problem. Please feel free to ask me regarding this.
Regards,
Chandrachur. -
ODI - refresh a variable from a file field
Hi,
Is it possible to refresh directly a ODI variable from value stored in a file ? I find a workaround by loading the file into a temp table, and then make a variable refresh, but this solution is not good for me.
Any other idea ?
Thanks,
JPhttp://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value
gives you the step for refreshing variable from file -
ODI variable refresh from a file
In one of the the threads in the past I read some tips about how to refresh a variable from a flat file. I have some information in a flatfile which I need as a variable.
Now I am reading the flat file into a SQL table and then refreshing it into the variable. I guess we can do this in one step. I am sure I read blog something about it. If anyone aware of the thread can you send the link.
Thankshttp://odiexperts.com/?p=243
http://odiexperts.com/?p=243 -
Hi ,
Can anyone tell me , how to use odi variables in odi procedures and functions .
Thanks
BhoopendraHi Bhoopendra,
Check the below link,
http://download.oracle.com/docs/cd/E14571_01/integrate.1111/e12643/procedures.htm#CHDCJHJF
Thanks,
Guru -
Refresh input variables in Webtemplate
Dear All,
I have a command button in my webtemplate. when i click on this button it should give me variable selection screen to enter Country code in my input variable. My planning function will be executed for this country. But next time when i click this button its not asking me the variable selection screen.its taking the previous entered value. So i have to run the Webtemplate again to run the planning function for a different input variable.
Please tell me how to refresh the variable values so that i can get the Popup screen everytime i click the command button.
Thanks in advance.Hi,
I have created one web template with one button group , and selected query having variable and exception as data provider.
For button group i have selected "OPEN_VARIABLE_DIALOG" (which is under All commands->command for webtemplate)as a command type. It is working fine.
Try this.
if it is useful assign points.
Regards,
Senthil Kumar.P -
How to use ODI procedures into a ODI variable
Hi,
I have the below condition
select c1 from table where c1>#ODIVAR1 and use the output of this query in a variable to define the package flow
If output=0 package flow goes as XXX
else
flow goes as YYY.
So please suggest how to use a ODI variable to capture the procedures putput and use it in package flow in this case.
Thanks,
Naveen.Step1 . Refresh the variable in the package, which have this query select c1 from table where c1>#ODIVAR1
Step2. Evaluate above variable (operator = , value 0 )
Step 3. If true Package flow xxx , else false yyy
Please close the thread once you get the required flow. -
ODI: Variable refresh via Jython?
Hello,
I have a very little question, I hope.....
I use the first time project variables with a SQL-Statement for refreshing...
But, how I can refresh this variable via Jython? Even I want to access it says, that no value exists.
IF I refresh manualy it works fine.
How can I init this explicit via Jython?
thanks....Did you try running the sqlldr command on the shell using the same control file ?
I guess it will work fine.
This is an ODI bug 8560194 due to which even if a single record errors out in sqlldr, the ODI signals an error despite the fact that LOA_ERRORS > 0
Hope that helps.
Maybe you are looking for
-
Partial Trigger is not working with Panel Group Layout using ADF 11g.
Friends, I have a requirment , Based on the <af:selectBooleanCheckbox> value I have to render <af:panelGroupLayout> dynamically. If the check box is checked then I have to display panel group layout otherwise not. The problem what I am facing here is
-
I lost my Personal Address file in Cyber Space and all of my contacts. I reinstalled my contact information into a new Personal Address file and want to make sure I save a copy of the file in case the file gets lost again. Also, when I created a new
-
Extending the display duration of text
What property controls the duration a text will be displayed. Currently, I have a 10 second animation, and after adding the text it disappeared after 3 seconds. I have chosen a LiveType font (Iglow) and when I changed the direction property to Ping-P
-
Forms Standard Canvas/Window Sizes for
Hello: What are the standard sizes of Window and Canvas for Oracle Forms to run on 1024/768 Pixel or higher resolution? We like to size the screens such a way that the users can see the whole Form Window/Canvas in both Client Server as well as Browse
-
Different user options with different sets of questions
Is there a way I can have two different options and when the user clicks on option A a whole set of questions/form fields appear. Or if they select option B a whole different set of questions/form fields appear? How would I go about programming somet