chonabraham
asked on
automatically generated text fields in MySQL
How do I create a test auto-generated field in a MySQL table? Can this field be used as a primary key? If so, what is the syntax for the create statement?
For example
Create table test (
text_id varchar(50) not null generated,
primary key (text_id));
For example
Create table test (
text_id varchar(50) not null generated,
primary key (text_id));
ASKER
can you have a Pk that is varchar and have MySQL generate the unique characters? How do you get MySQL to generate a unique varchar combo to use as the value for any field?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For a primary key the field must be unique - you can use an autonumber but this is an int field?
Not sure what you are asking?