MySQL Forums
Forum List  »  Newbie

Re: Random Value as Default in Column
Posted by: Phillip Ward
Date: May 30, 2014 05:06AM

Quote

I am fine with unique record but it has to be combination of Text + Number and MySQL should generate internally just like Primary key on Int column
A combination of some text and a number? That sounds like two fields to me:
* A text field that you provide, and
* An auto-increment number.

Put the two fields together when you need to display them (actually, get your presentation layer/ application to do that but) but store them separately.

I'm assuming here that you're going to give MySQL the text "bit" to use. If you're not going to do that and you want MySQL to "just make something up", then I really can't see the point in having it at all. Just go with the auto-incrementing number.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
V S
May 29, 2014 01:04AM
Re: Random Value as Default in Column
May 30, 2014 05:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.