cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase the constant value and extra alpha character for each loop without UDF .

Former Member
0 Kudos

How to increase the constant value and extra alpha character for each loop without UDF .

Example : presently XYZ/MM --- > XYZ/MM

we need to change

XYZ/MA

XYZ/MB

XYZ/MC

XYZ/MD

XYZ/ME

XYZ/MF

or

XYZ/YESL

XYZ/LKSJ

XYZ/JSHL  ( any random unique. )

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

or can you give me UDF code and how to use.

Former Member
0 Kudos

Hi Finaly we have fixed using UDF

--------------------------------------------------------------------------------------------------------

final String AB = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

Random rnd = new Random();

StringBuffer sb = new StringBuffer(a);

for (int i = 0; i < 4; i++) {

            sb.append(AB.charAt(rnd.nextInt(AB.length())));

        }

        return sb.toString();

------------------------------------------------------------------------------------------------------------

Thanks  for all the support.

Answers (3)

Answers (3)

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Praveen,

Can you please elaborate the requirement for better understanding.

Depending upon the requirement, our first choice will always be graphical functions, and then UDF.

Regards

Vishnu

former_member216164
Participant
0 Kudos

Hi,

You can use a fix value lookup for this like follows.

If loop =1 retreive and append alphabet A

if loop =2 retrieve and append alphabet B

.

.

.

1A
2B
3C
4D
5E
6F
7G
8H
9I
10J
11K
12L
13M
14N
15O
16P
17Q
18R
19S
20T
21U
22V
23W
24X
25Y
26Z




Thanks,

Avinash.

Former Member
0 Kudos

That could be a difficult requirement.

Thinking outside the box, haven't tried this, but maybe you do a JDBC lookup to database stored procedure which keeps sequence externally and returns the next unique value.