Dee Jay
Dee Jay

Reputation: 21

Talend tMSSQLInput

I created a Talend MS Sql job using tMSQLInput_1 and inserted my own query. Below is example of my query.

if  object_id('tempdb..#lang_guid')is not null 
    drop table #lang_guid;
  create table #lang_guid(
                patient_guid varchar(255)
               ,accountid varchar(255)
               );
   insert into #lang_guid

        select  c.customerid
               ,'0000001'
          from  customer c with(nolock)

  select patient_guid
        ,accountid

    from #lang_guid

The issue I'm having is the query pulls the patient_guid from the table but not the accountid I creating that on the fly in the temp table. when i run the job in Talend it returns the patient_guid but I don't get any data back for the accountid. Have anyone seen this issue with Talend before and if so how do I fix it.

Upvotes: 2

Views: 1645

Answers (5)

Sourav
Sourav

Reputation: 1

Here are the steps you need to follow:

  • You need to write the exact query to fetch the fields you seek, in your case it may be select patient_guid, accountid from customer c with(nolock)
  • Then you have to click guess schema to populate metadata for the component.
  • You can check the fields by clicking Edit Schema button in component view.
  • Then connect it to tLogRow to see whether your intended data is coming or not.
  • Other wise, simply write the query Select * from customer c with(nolock) -> Guess Schema -> Connect it with tLogRow and see which field your data is coming from -> then add tFilterColumn to pick your choice of fields and process the data further.

I hope I was helpful, please provide your feedback.

Upvotes: 0

Ankit Khanduri
Ankit Khanduri

Reputation: 31

Click on Guess schema which is above Query box or click on edit schema and define your schema or you can have a look at Talend documentation as provided below https://www.talendforge.org/tutorials/tutorial.php?idTuto=11&nbrFields=10&validate=true

Upvotes: 0

Naga Pradeep
Naga Pradeep

Reputation: 202

Check the schema at the tMssqlInput compont (defined against the fetch query) has both columns.

Upvotes: 0

jmf
jmf

Reputation: 396

In tMssqlInput, if you click on Guess schema you can see what columns are detected from your query.

Upvotes: 3

mhassine
mhassine

Reputation: 191

Did you define the corresponding schema ? In Talend, when using an input component (a Database or any other input), you have to define a schema by clicking on ..., in the component view of tMSSQLInput.

You should have two defined columns in your case.

Make sure that for every input, the right talend Schema is defined.

Upvotes: 1

Related Questions