Focal Point
Generate sequence number

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/3257092495

November 25, 2010, 07:51 AM
Amigos
Generate sequence number
How can we generate sequence numbers and attach that to the data which need to be uploaded to a particular field in a database table.

For example there is a EmployeeAccessCode field in the Employee table, and This field needs to filled using the first two characters of the Employee name (using _substr function) and then 4 digits (generated sequence number).
i.e. _CONCAT(_substr(EmployeeName),SENERATED_SEQUENCE_NO)

I am using iWay ISM version 5.5, with SQL server 2008 as the database.. OS Win XP. I am looking out for some possible option with the iWay Designer objects.

Thanks
November 26, 2010, 09:18 AM
iWay Newbie
Hi Amigos,

have you tried the unique function:

 _CONCAT(XPATH(//EmployeeName), _UNQ(###)) 


This should give you: Amigos001, Amigos002, ..., Amigos999

Just adjust the pattern to include the number of digits you need.

Note that if you have more than one EmployeeName field, you might end up with something like:

 Amigos1|Amigos2|Amigos3001 


Hope this helps...

Newbie


--
WebFOCUS 8.2.03 on Linux
November 27, 2010, 02:46 PM
Amigos
Thanks.. this solution worked.