Solved

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

Posted on 2013-01-05
1
342 Views
Last Modified: 2013-01-06
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
Comment
Question by:Honya
1 Comment
 
LVL 24

Accepted Solution

by:
johanntagle earned 500 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now