count of number of records

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

count of number of records

Post by rafidwh »

Hi All,
Ihave ajob which does the update insert logic

My job has a source file and the target is oci
I have selected the update existing and insert new rows from the update action

Now how can i get the count of number of records updated and number of records inserted


Note: Here I am using only one link not two links

Thanks in advance
Saik
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I dont think you can get Updates and Insert specific numbers in you have an update/insert option in your target OCI. I believe for that you need to split your inserts or updates. Or predetermine the inserts by doing a simple lookup on the target table.
If someone has knowledge of determining inserts and updates on insert/update option i would be really keen to learn that.
Regards,
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: count of number of records

Post by chulett »

rafidwh wrote:Now how can i get the count of number of records updated and number of records inserted? Note: Here I am using only one link not two links.
Can't be done.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: count of number of records

Post by gateleys »

Yet another reason why I would do the inserts and updates separately.

gateleys
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Yet another reason why I would do the inserts and updates separately.
Me too.. :)
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

If you really want the insert/update logic to be handled by the database, all you need to do is do a lookup on the target, that will give you the inserts,
subtract that from the total, that will give you updates.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Post by mab_arif16 »

DSguru2B wrote:If you really want the insert/update logic to be handled by the database, all you need to do is do a lookup on the target, that will give you the inserts,
subtract that from the total, that will give you updates.
Just a thought ,if you can access the director log ,using dsjob -logdetail command from command line and by using unix commands such as awk, grep get the no of records inserted and updated.
Thanks
Arif
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll get one number - the total number inserted and/or updated - but not the two distinct numbers the OP wants.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Post by mab_arif16 »

chulett wrote:You'll get one number - the total number inserted and/or updated - but not the two distinct numbers the OP wants.
Using a shell script can't we do it twice once for inserted and other for updated ,if there are two nodes you can add the numbers
Thanks
Arif
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Doing it twice or thrice on the same link gives the same answer everytime. If you mean links by nodes, then, yes..we can get the desired results with two links. But OP's question was, if its possible when updating and inserting through only one link.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Read the original post. They are using a single link with one of the combo update actions so there's no way to get separate numbers for inserted versus updated records.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply