MySQL Forums
Forum List  »  Newbie

Trying to set a default id field to a uuid
Posted by: Paul P
Date: September 09, 2017 01:05PM

Hello,

I am trying to set up a table and set the default value to a UUID.

I tried something like

CREATE TABLE tests(
id char(36) PRIMARY KEY DEFAULT uuid()
)

I am getting a syntax error "near uuid".

I greatly appreciate your assistance.

Options: ReplyQuote


Subject
Written By
Posted
Trying to set a default id field to a uuid
September 09, 2017 01:05PM


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.