One Star VTA
One Star

t_oracle_input then send an e-mail of the results

Hi everybody,
I've got some troubles to use t_oracle_input.
I would like to make a select query and to put the results in a mail body.
This mail will be sent automatically after that.
But when i execute the job, i've got some error messages:
Exception in component tOracleInput_1
java.lang.ArrayIndexOutOfBoundsException: 4
at oracle.jdbc.driver.T4C8TTIdty.marshal(T4C8TTIdty.java:465)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:329)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:490)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
For the components, I use t_oracle_input and t_send_mail.
Can you help me please?
Thanks for your effort.
5 REPLIES
Community Manager

Re: t_oracle_input then send an e-mail of the results

Hello guy
How do you link to tSendEmail after tOracleInput? Do you want to send all the rows in a email or each row in a email?
Please upload a screenshot of your job.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star VTA
One Star

Re: t_oracle_input then send an e-mail of the results

Hi Shong,
I would like to send all the rows in an e-mail.
I'm not sure about the link, maybe you can help me.
I don't even understand what's the meaning of:
- row > main
- trigger > onSubJobOk
- trigger > obComponentOk
Are you talking about these links?
Thanks for your help.
VTA
One Star

Re: t_oracle_input then send an e-mail of the results

Hi VTA,
If you want to send the results in one e-mail then you must accumulate the results in a string global variable and then use that in the body of the e-mail. If there are a larger number of results then I'd suggest outputting the results into a text file and attaching that to the e-mail.
What you have done is an Iterate on each row - this job actually doesn't do anything, so you'll need:
- create a string context variable (results)
- design your job like:

tOracleInput_1 --row1--> tJavaRow
|
|
on Subjob OK
|
|
v
tSendMail
In the tJavaRow:
context.results = context.results + "\n" + row1.result;

In the tSendMail, body
context.results

I don't even understand what's the meaning of:
- row > main
- trigger > onSubJobOk
- trigger > obComponentOk

If you don't know what these terms mean then you are going to have great difficulty in designing effective jobs. I would suggest you read section "4.4 Connecting components together" on page 62 of the User Guide.
Cheers,
c0utta
One Star VTA
One Star

Re: t_oracle_input then send an e-mail of the results

Hi Coutta,
Thanks for your help and your information.
But i've got a new problem. It concerns the Java code. It seems that Talend cannot resolved the instruction vta_row.result.
Indeed, when i put in the code "vta_row.", the auto-completion function doesn't suggest me "result".
Are you sure about this property?
I downloaded the components guide in Talend website but i don't find anything. Does it exist some javadoc for java components?
I put a screenshot of my job.
Thanks a lot.
VTA
One Star

Re: t_oracle_input then send an e-mail of the results

Hi VTA,
result != results. You have a typo.
Auto-completion will not suggest all the flows, only context variables and component variables.
Cheers,
c0utta