This content has been marked as final.
Show 12 replies
-
1. Re: Script error through ODI
Bhabani Ranjan Mahapatra Dec 14, 2012 7:18 AM (in response to rv)If you have the error file generated then we can read those line and print them in operator. Send me the error file. I can say the codes to print it in operator.1 person found this helpful
If you know jython then you can even read the error line in to a string and raise the same string which will print it in operator.
Thanks
Bhabani
http://dwteam.in -
2. Re: Script error through ODI
rv Dec 14, 2012 9:20 AM (in response to rv)Thanks,
Can you please send me the details of how to print that on operator.
Suppose my error file name is "Test.err".
I tried by using jython code in ODI procedures.I was testing with the following code in Procedures
----------------
import re
str1='This is a program'
if re.search("is",str1):
print ' Match found'
else:
print ' Not Found'
-------------------------------------
The Odi procedure is running successfully but on the message box it is not showing the output .
It is showing blank.
Please reply fast.. -
3. Re: Script error through ODI
Bhabani Ranjan Mahapatra Dec 14, 2012 9:29 AM (in response to rv)please provide one tab or space before raise to avoid expecting INDENT" error1 person found this helpful
import re
str1='This is a program'
if re.search("is",str1):
raise ("\n\n\n Match found \n\n\n")
else:
raise ("\n\n\n Not Found \n\n\n") -
4. Re: Script error through ODI
rv Dec 14, 2012 9:34 AM (in response to Bhabani Ranjan Mahapatra)Is there a difference between print and raise.
I ran the code with raise but it is showing error like:
-------------------------------------------------------------
org.apache.bsf.BSFException: exception from Jython:
SyntaxError: ("mismatched input 'raise' expecting INDENT", ('<string>', 4, 0, 'raise ("\\n\\n\\n Match found \\n\\n\\n")\n'))
at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:346)
at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2457)
at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:47)
at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:662)
------------------------------------------------------------------------------------------------------------------------------------ -
5. Re: Script error through ODI
Bhabani Ranjan Mahapatra Dec 14, 2012 9:40 AM (in response to rv)Have you given a space as i said just before to the raise??? you have not given a space that why you are getting INDENT error1 person found this helpful
import re
str1='This is a program'
if re.search("is",str1):
<space required> raise ("\n\n\n Match found \n\n\n")
else:
<space required> raise ("\n\n\n Not Found \n\n\n") -
6. Re: Script error through ODI
rv Dec 14, 2012 10:24 AM (in response to rv)This works...
How to read the error file and return the error in the message box.
Suppose my error file is on the location "/E/common.test.err".
I need to display the text inside the test.err in the message box. -
7. Re: Script error through ODI
Bhabani Ranjan Mahapatra Dec 14, 2012 10:29 AM (in response to rv)technology: Jython1 person found this helpful
file = open("D:/FF/test.txt", "r")
for line in file.readlines():
raise line
file.close()
Thanks
Bhabani
http://dwteam.in -
8. Re: Script error through ODI
rv Dec 14, 2012 10:39 AM (in response to Bhabani Ranjan Mahapatra)Is it reading only the first line of the file.
What if we want read all the text present in the file.
Thanks -
9. Re: Script error through ODI
Bhabani Ranjan Mahapatra Dec 14, 2012 10:47 AM (in response to rv)file = open("D:/FF/test.txt", "r")
allline=' '
for line in file.readlines():
allline=allline+line
raise allline
file.close()
Hope I answer all your question.
Thanks
Bhabani
http://dwteam.in -
10. Re: Script error through ODI
rv Dec 14, 2012 10:48 AM (in response to Bhabani Ranjan Mahapatra)Amazing.....
Thanks a lot.....
I owe you a treat man..........
Thanks for your response -
11. Re: Script error through ODI
Bhabani Ranjan Mahapatra Dec 14, 2012 10:53 AM (in response to rv)you are welcome :)
Please mark the answers as helpful if it really helped.
Thanks. -
12. Re: Script error through ODI
rv Dec 14, 2012 10:52 AM (in response to Bhabani Ranjan Mahapatra)Did it...