Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
running code or pseudo code of table structure 5 30
mysql update statement 3 30
ORA-04071: missing BEFORE, AFTER or INSTEAD OF keyword 2 61
Very Large data in MYSQL 7 73
This article describes some very basic things about SQL Server filegroups.
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…

791 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