You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2014-12-19 04:44:21

er1992
Member
8 posts

er1992 said:

tOracleInput returning null

Hi
I am trying to run an xmlElement based select query in the sql builder, this one to be specific:

select XMLELEMENT("Emp",
   XMLFOREST(e.last_name, e.salary), 
   e.employee_id
   )
from HR.EMPLOYEES e

and the result I am getting is 117 rows of <Null>. I have run this query in the sql developer and get complete results. I was suspecting this might be since I dont have a root element but then I would be unsure of making a query that could accomplish that. Just tested, same result still but only one row cause of one root element. The output from tOracleInput then would go straight to the trestresponse.

Not sure how I should go about doing it the the studio or is this a bug?

My overall goal is a REST web service which returns an xml document which the schema and form of the xml could vary based on parameters passed in by the URL. I have already tried the tXMLMap way but there would be at least over 50 different outputs and it can soon become unmanageable. Something else I thought of was to build a conditional select query on each selected fields so that I could use the "Create empty Element" in the txmlmap output setting and in case of that specific field being null in the select query then I would achieve the dynamic schema I was going for. 

Any ideas, suggestions folks? Would appreciate some help.

Last edited by er1992 (2014-12-19 04:50:26)

Offline

#2 2014-12-22 04:26:00

xdshi
Talend Team


xdshi said:

Re: tOracleInput returning null

Hi,

Could you please show your job setting screenshot with us?

Can you use a simple query in your job to see if it is working well?(select * from HR.EMPLOYEES e).

Best regards
Sabrina


What we can do is to make sure that Talend will be your best choice!

Offline

#3 2014-12-22 07:17:15

er1992
Member
8 posts

er1992 said:

Re: tOracleInput returning null

Hi Sabrina

Thanks for the reply.

The simple select * or select specific fields works fine with the db and returns 117 rows of data, the only issue here is with the select XMLElement. 
The screenshot that I have attached is a revised version of what I originally had in mind. This version -as explained in the original post- could easily become unmanageable as the number of URI attributes grow and more outputs from the txmlmap would be needed.
The top lane returns the full table but the bottom lane one returns the record that matches the id passed on by the URI 

rgbOwdU.jpg

Last edited by er1992 (2014-12-22 07:20:46)

Offline

#4 2014-12-22 10:47:19

xdshi
Talend Team


xdshi said:

Re: tOracleInput returning null

Hi,


Have you tried  to use the tExtractXMLField to retrieve value of your field, then inserting the value and manually creating the XMLElement() in your Select clause ?


Best regards
Sabrina


What we can do is to make sure that Talend will be your best choice!

Offline

#5 2017-03-15 18:36:16

amit.dev.d9
Member
22 posts

amit.dev.d9 said:

Re: tOracleInput returning null

Hi Friends,
I am facing similar issue.Based on above advice , I tried tExtractDelimitedField but still getting the same null value.
I am working on this job how last ONE MONTH mad.
Any advice will be appreciated ...
I have a another open discussion as well where guys are helping me out but more help is always good.
https://www.talendforge.org/forum/viewt … p?id=55245

mini_image.png_20170315-1030.png

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy