Forum Discussion
@Dheeraj
I have a 10 rows in Database with field name ‘Product_ID’ so in pipeline after getting the field i have to take last number like in ‘P-00010’ i have to take ‘0’ and increment by 1 in pipeline and update back to the database like ‘P-00011’ .
Hope you got my point, Please give me solution
Hello @rjapala,
Try with the following expression in a Mapper Snap:
"P-%05d".sprintf(parseInt(parseInt($Product_ID.split("-")[1])+1))
Let me know if this helps you.
BR,
Aleksandar.
Thank you @AleksandarAngelevski for your reply
This is not working in realtime like i have created trigger task for my pipeline so whenever i hit from postman to the pipeline it should generate new Product id in database.
So iam confused how to solve can you please help me on this
Hi @rjapala,
Good day, here’s an sql script that will update the product_id you can use the sql server execute snap to place the script
update yourtable set product_id = format(convert(int, replace(isnull(product_id,'0'),'P-','')) + 1,'P-0000#')
Thanks,
EmEm
Related Content
- 10 months ago
- 4 months ago
- 4 months ago