skip to Main Content

I have made relational database model using MagicDraw tool. Every cashier has their workTime type saved in enumerator:

enter image description here enter image description here

Then I generate DDL code and try to paste it into phpMyAdmin to generate DB but I get many errors. I tried to fix them by hand but errors are still here. So how should that check statement be written?

SQL CHECK statement

Errors:
Errors

2

Answers


  1. Chosen as BEST ANSWER

    I think I have found a solution.

    A book that I was following to create DDL from MagicDraw project suggested to pick "Check Constraints" as an "Enumeration transformation strategy" when transforming model. It didnt worked that way so I have chosen "Lookup tables" instead and DDL code seems to be working now.

    However it still had some erorrs. I had to add semicolons after all INSERT statements. enter image description here

    And I also had to delete word "precision" after every 'double' type: delete

    It works now.


  2. A check constraint isn’t part of a column’s definition, it’s its own clause in the table definition. You need a comma between the worktime char(13) not null and the check.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search