Skip to main content
Participant
June 26, 2008
Question

Handling Strings?

  • June 26, 2008
  • 2 replies
  • 245 views
I'm currently working with a database, in which some primary keys are varchars. I'm supposed to make an application that creates an "automatic" primary key for each new register, currently for instance, if the max(pk) is 100, the new one is 101. My question is, how to handle strings in a way in which if max(pk) is abx, I can do abx +1 to get aby - or similar. Any comments?
    This topic has been closed for replies.

    2 replies

    Inspiring
    July 3, 2008
    you can also make use of your db capabilities instead of letting cf do the work. try reading the documentation for your db regarding auto create string PK.
    Inspiring
    June 29, 2008
    Do the strings have to be sequential in some way or do they simply need to be unique? If it's the latter you could just use the CF function CreateUUID. This will create unique strings for a primary key. Might not fit your needs but could be a quick solution.

    Cheers,
    Craig