Solved

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

Posted on 2013-01-05
1
351 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
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…

679 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