cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate the unique ID

Former Member
0 Kudos

Hi Experts,

I am having the scenario JMS to JDBC.

I am having the requirement to genrate the unique id for a particular batch.

It is not necessary to genrate the id in sequence.It can be a random number also. for example say for 1st record---> it can be any number which should be unique in a particlar batch.

my structure is like

N ---> N1

N21

N22

My N2 field getiing repeated occerence 0.n (N21,N22). I want the same unique Id in both the N21 and N22 field and in field N1 as well.

Means to say same unique id that we are generating from source should be populated in N1, N21 and N22.

My Doubts are

1- how can i genrate the unique id.

2- How can i get the unique id in N1, N21 and N22 fileds.

Thanks in advance

Ram.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Refer this forum link

Thanks

Vikranth

Answers (1)

Answers (1)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi amit,

Thanks for your quick reply.

My unique id should not be a time stamp, it should be a number.

Thanks,

Ram.

Former Member
0 Kudos

Hi,

The sample code which I mentioned above will return you number only. Please try it.

Thanks

Amit

Reward points if it helps

Former Member
0 Kudos

Does that solve your purpose?

Thanks

Amit

Former Member
0 Kudos

Thanks amit.

We are able to generate a uniqueid but, How to assign it to all the unique id fields at a go?

Is their a possibility, storing uniqueid (generated by UDF) as a global variable,and then map the global variable to uniqueid at nodes N1,N21,N22.

Thanks,

Ram.

Former Member
0 Kudos

Hi,

You can for instance use the java section to initialize a global variable - i.e. to the unique id suggested by Amit. Then u can simply refer to that global variable from a UDF - that is use the same UDF in all required fields in the target structure.

Regards,

Daniel