Solved

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

Posted on 2013-01-05
1
346 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
ID: 38748208
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…

912 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

26 Experts available now in Live!

Get 1:1 Help Now