MySQL Forums
Forum List  »  Newbie

Re: Trying to set a default id field to a uuid
Posted by: Peter Brawley
Date: September 09, 2017 02:46PM

MySQL still doesn't support default function calls, so you'll need to default it to null and write a Trigger that does ...
if new.id is null then 
  set new.id=uuid(); 
end if;

Options: ReplyQuote


Subject
Written By
Posted
Re: Trying to set a default id field to a uuid
September 09, 2017 02:46PM


Sorry, only registered users may post in this forum.

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.