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 2017-03-14 16:19:44

khaled.tawfik
Member
2 posts

khaled.tawfik said:

Using tmysqlSP and Tmap

Hello,
so i have a database table containing different months and a function in my database taking two inputs: 1)month. 2)year
i am using tmysqlSP to return a calculated value.
But the problem is if i have more than one month, how can i adjust my tmysqlSP to take each month as input and output it in each record of it's own.
As you can see in my example, the attrition rate should change as the number of the month and store it with the correct month.
so any ideas on how can i do this bit ?
mini_Capture1.png

Last edited by khaled.tawfik (2017-03-14 16:21:15)

Offline

#2 2017-03-15 08:18:02

vapukov
Member
470 posts

vapukov said:

Re: Using tmysqlSP and Tmap

Look for problem from other side - how You can have this result in MySQL? something like:

SELECT col1, col2, function(month, year) as rate FROM mytable 


You can use this in tMySQLInput, in tMySQLInput setup proper schema related to query, and it will work as expected

Last edited by vapukov (2017-03-15 08:18:25)

Offline

#3 2017-03-15 08:48:45

khaled.tawfik
Member
2 posts

khaled.tawfik said:

Re: Using tmysqlSP and Tmap

sorry i didnt understand what you mean, can you repeat that again ?

Offline

#4 2017-03-15 09:01:47

vapukov
Member
470 posts

vapukov said:

Re: Using tmysqlSP and Tmap

khaled.tawfik wrote:

sorry i didnt understand what you mean, can you repeat that again ?

I will try
it You wrote - 

i have a database table containing different months and a function in my database taking two inputs: 1)month. 2)year

correct?
so, if all of this You have in database
You can run queries like:

SELECT col1, col2, function(month, year) as rate FROM mytable 

You can edit for Your columns, tables and functions name
all this follow from Your initial post

so I tell You - You do not need tmysqlSP, put this query in tMySQLInput, and it will work 


If it not clean for - it Your time to explain what is Your problem and what You need as help smile

Last edited by vapukov (2017-03-15 09:05:23)

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy