• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

How do I create a constructed artifical key for a Product table?

Hi,

Can any one suggest with examples, how to create a 13 digit constructed key for a product table in an e-commerce system?
0
Honya
Asked:
Honya
1 Solution
 
johanntagleCommented:
If you're using MySQL and this is for the primary key of the table I suggest you just stick to an integer primary key generated by auto_increment.  Integers as keys are the most efficient when using MySQL.

The uuid() MySQL function (http://dev.mysql.com/doc/refman/5.0/en//miscellaneous-functions.html#function_uuid) can generate for you a unique string, but it's 36 characters long.  If that is not acceptable then you may need to look for a solution outside the database.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now