You are not logged in.
Announcement
Unanswered posts
|
Ok, thanks a lot; yes, error symbol is related to the wrong schema.
The schema of the DB input component does not automatically change to match the query you use; you must change it manually. When you do, it will ask to propagate to the following components.
I also note an error symbol against your tHashInput. This possibly indicates you have not set up a schema for it.
Ok, I've tried to implement the alevy's job schema (see the image), but I don't see any data.
My "INPUT" table, is based on a table of the destination output, but I wanna change the query to do count operations on my data; the query is the following:
--------
select
count(*) as CONTA,
pa.id_dipendente,
pa.cognome,
pa.nome,
ete.data_evento,
ece.DESCR_CLASSE,
eae.DESCR_AMBITO,
eti.DESCR_TIPOLOGIA
from per_anagrafica pa
inner join EVA_REFERENCES er on er.ID_FOR_ALL = pa.ID_DIPENDENTE
inner join EVA_TESTATA_EVENTO ete on er.ID_EVENTO = ete.ID_EVENTO
inner join EVA_CLASSI_EVENTO ece on ete.id_classe = ece.id_classe
inner join EVA_AMBITI_EVENTO eae on ete.ID_AMBITO = eae.ID_AMBITO
inner join EVA_TIPOLOGIE_EVENTO eti on ete.ID_TIPOLOGIA = eti.ID_TIPOLOGIA
inner join EVA_REFERENCE_TYPES ert on ert.ID_EVA_REFERENCE_TYPES = 4
group by
ete.DATA_EVENTO,
ece.DESCR_CLASSE,
eae.DESCR_AMBITO,
eti.DESCR_TIPOLOGIA,
pa.cognome,
pa.nome,
pa.id_Dipendente
having count(*) > 0
order by cognome, nome
----------------
Opening the tHashOutput_1 "Edit schema", I see the original fields of the table and not the results of my custom query.
Where I wrong?
Ok, it was more simple as I thought...perfect!
Thanks a lot alevy
You want to count users in the DB so just use SQL statement in your input component that does so (e.g. SELECT user, count(*) from table group by user) and set the schema to match the query results.
Please, can you paste in the topic a simple example made in TOS about first steps above?
To count users, have I to use a tMap, or have i to change table schema query?
Thanks all, sorry but I'm moving first experiences with TOS and not all my doubts are explaned in the Help or I'm not able to find them in the forum.
alevy wrote:
Go to File > Edit Project properties > Designer > Palette Settings and move the Technical folder from Hide to Show.
Thanks a lot!
Go to File > Edit Project properties > Designer > Palette Settings and move the Technical folder from Hide to Show.
Sorry, I don't have tHashOutput. Why? Is it a customer component? (My TOS vers 4.1.1)
alevy wrote:
So if I understand correctly, you want to compare the users in the source to the count of each user in the destination, summarise the count comparisons to a log file and write 1-1 matches from source to destination.
t[DB]Input (count by user) --> tHashOutput
|
OnSubjobOK
|
Source input --main--> --> log output
| tMap (left-join on user)
| tHashInput --lookup--> --> destination output (filter 1-1)
|
OnSubjobOK
|
| Source input --lookup-->
| tMap (left-join on user) --> append log output (filter 0-N)
tHashInput --main-->
|
OnSubjobOK
|
tSendMail
Yes Alevy, you understood very well! Thanks a lot for your answer!
I'll try to implement job and if I'll have some doubts I will ask againg. Thanks!
So if I understand correctly, you want to compare the users in the source to the count of each user in the destination, summarise the count comparisons to a log file and write 1-1 matches from source to destination.
t[DB]Input (count by user) --> tHashOutput
|
OnSubjobOK
|
Source input --main--> --> log output
| tMap (left-join on user)
| tHashInput --lookup--> --> destination output (filter 1-1)
|
OnSubjobOK
|
| Source input --lookup-->
| tMap (left-join on user) --> append log output (filter 0-N)
tHashInput --main-->
|
OnSubjobOK
|
tSendMail
Sorry Jans...but yours it's not an answer to my question, please open another topic.
Thanks
Hi all,
In one of the talend jobs , the Talend component <tActiveFTPget> is missing.... :-(
Could anyone kindly tell me where would I be able to download it from.
The Talend version I work on is v 3.0.3.
Kindly help me as this is very urgent.
Thanks,
Jans
Good morning to all,
I have a question about an operation I wanna do with Talend; the situation is the following:
I use Talend to take some data from origin (usually sql db, txt, csv, ...) and I put them always into SQL db. (this is a simple concept...)
I have, in origin and destination the same "User" record, I mean that I have a users table in the origin and I import them into the destination; in the origin file, the user has a field where there is a daily sum of credits (divided by type), instead into the destination, I can have more records for every type of credits;
e.g.
ORIGIN: USER1 - type 1 - 10 credits (3+3+4)
DESTINATION: USER1 - type 1 (ID = 1) - 3 credits
USER1 - type 1 (ID = 2) - 3 credits
USER1 - type 1 (ID = 3) - 4 credits
Now I want, before import data, check:
1. count and trace users that have 1 (origin) to 1 (destination) match - in this case I can import directly data
2. count and trace users that have 1 to N (> 1) match - I don't import data
3. count and trace users that have 1 to 0 match - I don't import data
4. count and trace users that have 0 to N (=> 1) match - I don't import data
Then I have 2 ways to follow:
1. I want count recors per each case and put these in a .txt log file, save log file in a folder and also send it by e-mail
e.g. of .txt structure:
"There are XX 1-1 match records;
There are YY 1-N match records (users' list);
There are ZZ 1-0 match records (users' list);
There are WW 0-N match records (users' list)"
2. Import only data where I have 1-1 match records (but in this case i think that could be simple doing in the tMap a count before insert: in destination field I put for example IF COUNT(...) = 1 "USER1 - 10 credits...)
Thanks a lot for help!
P.S. Sorry if my english is very bad...if you need more specs please ask me. If you need, I could also attach a screenshot of my "standard" job.