Incremented text

Discussion created by bigtom on Jul 1, 2014
Latest reply on Jul 2, 2014 by bigtom

I am working on part of a solution that generates URLs for records.


The issue is having the same URL. If there are multiple records for "Ford Falcon" or "Chevy Nova" I need URLs that are incremented such as "http://www.../ford-falcon.htm" and then "http://www.../ford-falcon-2.htm" and then "http://www.../ford-falcon-3.htm".


Looping through the entire database looking for a match of each increment and then appending the correct number is too intensive.


I was thinking of a table with all of the name values and and increment number. If the name is on the table get the number and increment +1. Finding an existing record and incrementing the value is easy.


If the name is not already in the table a new record needs to be added. The thing I am having trouble with is how to script somehting to happen when a match is not found. I am sure this is simple but I am missing it.