Re: CREATE TABLE Inv_Id

2006-10-19 Thread Scott Hamm
Wish MySQL would have something like what Microsoft use, uniqueidentifier as datatype.

Re: Re: CREATE TABLE Inv_Id

2006-10-19 Thread Dan Buettner
Scott, what's wrong with 'PRIMARY KEY' ? Dan On 10/19/06, Scott Hamm [EMAIL PROTECTED] wrote: Wish MySQL would have something like what Microsoft use, uniqueidentifier as datatype. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: Re: CREATE TABLE Inv_Id

2006-10-19 Thread Martijn Tonies
Scott, what's wrong with 'PRIMARY KEY' ? A PRIMARY KEY has nothing to do with the uniqueidentifier datatype. A uniqueidentifier is a GUID. Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts:

RE: Re: CREATE TABLE Inv_Id

2006-10-19 Thread Jerry Schwartz
Message- From: Martijn Tonies [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 9:45 AM To: Dan Buettner; Scott Hamm Cc: Mysql Subject: Re: Re: CREATE TABLE Inv_Id Scott, what's wrong with 'PRIMARY KEY' ? A PRIMARY KEY has nothing to do with the uniqueidentifier datatype

CREATE TABLE Inv_Id

2006-10-16 Thread Scott Hamm
I'm trying to create a table as follows: CREATE TABLE Inv_Id ( ID INT(12) AUTO_INCREMENT PRIMARY KEY, MID INT NOT NULL, FOREIGN (MID) REFERENCES 'Model' (ID) ); How do I make ID to start out as '0001' for UPC barcode assignment

Re: CREATE TABLE Inv_Id

2006-10-16 Thread Gerald L. Clark
Scott Hamm wrote: I'm trying to create a table as follows: CREATE TABLE Inv_Id ( ID INT(12) AUTO_INCREMENT PRIMARY KEY, MID INT NOT NULL, FOREIGN (MID) REFERENCES 'Model' (ID) ); How do I make ID to start out as '0001' for UPC barcode assignment? UPC barcodes are not sequential

Re: CREATE TABLE Inv_Id

2006-10-16 Thread Dan Buettner
you can do is left pad it with zeros whenever you select it: select LPAD(id,12,0) from Inv_Id order by id; HTH, Dan On 10/16/06, Scott Hamm [EMAIL PROTECTED] wrote: I'm trying to create a table as follows: CREATE TABLE Inv_Id ( ID INT(12) AUTO_INCREMENT PRIMARY KEY, MID INT NOT NULL, FOREIGN

Re: CREATE TABLE Inv_Id

2006-10-16 Thread Scott Hamm
. Clark [EMAIL PROTECTED] wrote: Scott Hamm wrote: I'm trying to create a table as follows: CREATE TABLE Inv_Id ( ID INT(12) AUTO_INCREMENT PRIMARY KEY, MID INT NOT NULL, FOREIGN (MID) REFERENCES 'Model' (ID) ); How do I make ID to start out as '0001' for UPC barcode assignment? UPC

Re: CREATE TABLE Inv_Id

2006-10-16 Thread Rolando Edwards
: CREATE TABLE Inv_Id Scott Hamm wrote: I'm trying to create a table as follows: CREATE TABLE Inv_Id ( ID INT(12) AUTO_INCREMENT PRIMARY KEY, MID INT NOT NULL, FOREIGN (MID) REFERENCES 'Model' (ID) ); How do I make ID to start out as '0001' for UPC barcode assignment? UPC barcodes

Re: CREATE TABLE Inv_Id

2006-10-16 Thread Gabriel PREDA
I would try: CREATE TABLE Inv_Id ( ID INT(12) UNSIGNED ZEROFILL AUTO_INCREMENT PRIMARY KEY, MID INT NOT NULL, FOREIGN (MID) REFERENCES 'Model' (ID) ); Note the UNSIGNED and ZEROFILL flags ! -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Gabriel PREDA Senior Web Developer -- MySQL General

Re: CREATE TABLE Inv_Id

2006-10-16 Thread Scott Hamm
Thanks! On 10/16/06, Gabriel PREDA [EMAIL PROTECTED] wrote: I would try: CREATE TABLE Inv_Id ( ID INT(12) UNSIGNED ZEROFILL AUTO_INCREMENT PRIMARY KEY, MID INT NOT NULL, FOREIGN (MID) REFERENCES 'Model' (ID) ); Note the UNSIGNED and ZEROFILL flags