on 08-16-2007 3:00 PM
Hi,
Iam doing a jdbc-to-jdbc scenario in which one of target table field has to be filled with a number in the following way.
Initially it should have 1 and for every execution of the scenario it should increase by 1 i.e for 2nd time execution it should be 2 like that....
anybody Please help me regarding this.
Thanks & Regards,
Radhika.
When the same payload contains multiple occurrences, then standard functions could be used.
For case where the messages are separate, this needs to be handled at the receiver end itself. Or may be handled in XI using the JDBC lookup
Another option would be to send some indicator from Sender and map accordingly.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the folllwoing UDF may help to you:
<b> Increment the Global Variable Counter</b>
public String incrementCounter(String a,Container container){
if(a.equals(" "))
{
Object o = container.getGlobalContainer().getParameter("CNTR");
Integer ii;
if( o == null ) ii = new Integer(0);
else ii = (Integer)o;
ii = new Integer( ii.intValue() + 1);
container.getGlobalContainer().setParameter("CNTR", ii);
String temp = ii.toString();
switch( temp.length() )
{
case 1: temp = "00"+ temp; break;
case 2: temp = "0"+ temp; break;
}
return temp;
}
else return " ";
<b>Intialise the Counter</b>
Object o = container.getGlobalContainer().getParameter("CNTR");
Integer ii = new Integer(0);;
container.getGlobalContainer().setParameter("CNTR", ii);
return "1";
Warm Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Radhika,
Use<b> Counter</b> function.
This sample will help you.
http://flickr.com/photo_zoom.gne?id=1064675164&size=o
http://flickr.com/photo_zoom.gne?id=1064675430&size=o
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Ther is a function called Increment / Counter it will help
Regards
Agasthuri Doss
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.