Get the Input link record count and pass/insert into target
Moderators: chulett, rschirm, roy
Get the Input link record count and pass/insert into target
I have a job like
Oracle(Source) ---> Lookup ---> Join ---> Transformer ---> Oracle(Target)
My requirement is i need get the input link record count and pass that count value into Oracle(target) table as Total_input_records.
I have written routine in Server using Linkinfo. Its working fine. but in Parallel I am unable to write/modify.
Is there any functions available in PX with out writing PX routine to get input link record count.
Please help me to resolve this.
Thanks in advance.
--Gnan
Oracle(Source) ---> Lookup ---> Join ---> Transformer ---> Oracle(Target)
My requirement is i need get the input link record count and pass that count value into Oracle(target) table as Total_input_records.
I have written routine in Server using Linkinfo. Its working fine. but in Parallel I am unable to write/modify.
Is there any functions available in PX with out writing PX routine to get input link record count.
Please help me to resolve this.
Thanks in advance.
--Gnan
Re: Get the Input link record count and pass/insert into tar
Any Replies with PX routine or alternative of PX routine to achieve this??
If you want to the input number of records only which is from oracle table, you can write the before job routine to call the unix script.
In the script
count = select count(*) from the table_name
update table_2 set total_input_records = count
-------------------------
Hope this helps..
----------------------
MK
In the script
count = select count(*) from the table_name
update table_2 set total_input_records = count
-------------------------
Hope this helps..
----------------------
MK
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
Why not use @INROWNUM in the transformer for target rowcount column.....
@INROWNUM gives the number to each row that is passing through the tramsformer.. however the issue with this one is that if job is executing on multiple nodes, the @INROWNUM will give differenet numbers on the rows on each nodes.
If there are 2 nodes with two rows ..
it will give 1 and 2 for 1st and 2nd row as they are executing on node1
again it will give 1 and 2 to 3rd and 4th row as they are excuting on the node2.
so this will not give the correct count of the records ..
hope this helps
--------------------------
MK[/i]
@INROWNUM gives the number to each row that is passing through the tramsformer.. however the issue with this one is that if job is executing on multiple nodes, the @INROWNUM will give differenet numbers on the rows on each nodes.
If there are 2 nodes with two rows ..
it will give 1 and 2 for 1st and 2nd row as they are executing on node1
again it will give 1 and 2 to 3rd and 4th row as they are excuting on the node2.
so this will not give the correct count of the records ..
hope this helps
--------------------------
MK[/i]
Hi
call a unix script from datastage job(from before job subroutine) by passing the parameter like <projecetname> <jobname> <stagename> <linkname>
script should contain the following command.
dsjob -linkinfo <projecetname> <jobname> <stagename> <linkname> |head -1 | awk '{ print $5 }'>/path/outputfile.txt.
This /path/outputfile.txt file will be source and oracle will be target.Then insert.
Hop this will resolve the issue.
Thanks,
mspanda
call a unix script from datastage job(from before job subroutine) by passing the parameter like <projecetname> <jobname> <stagename> <linkname>
script should contain the following command.
dsjob -linkinfo <projecetname> <jobname> <stagename> <linkname> |head -1 | awk '{ print $5 }'>/path/outputfile.txt.
This /path/outputfile.txt file will be source and oracle will be target.Then insert.
Hop this will resolve the issue.
Thanks,
mspanda
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom