i want to read last entered alphanumeric ID from database and add one to its numeric part.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sivaraman DhamodaranRank #40 · 34.5K reputationPosted Jul 11, 2014, 12:56 AM EDT
Say for example,
Column Name: Vehicle_Reg_No.
Data:
TN 52 -CJ6656
TN 52 -CJ6657
TN 52 -CJ6658
In the above case you want to increment last portion of Number.
Like the above example, Can you please provide your data. This will help you in getting the answer.
sandhya Patel12 reputationPosted Jul 11, 2014, 1:05 AM EDT
value is like TPIFP0001
first time i entered it through insert cmnt.
from 2nd onwards i want to read it from table and increment by1
Sivaraman DhamodaranRank #40 · 34.5K reputationPosted Jul 11, 2014, 1:29 AM EDT
ToDo:
1) Take left of the string counting 5 through sub-string manipulation
2) Take Right of the String counting 5, and convert this as number, add 1, convert back to string.
3) Join left and right
Since I do not what DB you are using, I gave the Idea like above
VulpesRank #55 · 29.2K reputationPosted Jul 11, 2014, 1:39 AM EDT
sandhya Patel12 reputationPosted Jul 11, 2014, 3:52 AM EDT