in

The ORM Foundation

Get the facts!

How to add 'greater than' operator to an integer

Last post 02-15-2013 13:34 by Anonymous. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-15-2013 3:40

    How to add 'greater than' operator to an integer

     I know this should be really simple - but I can't figure out how to add a 'greater than' value range to an integer to ensure that it's value is at least 0. 

  • 02-15-2013 5:04 In reply to

    Re: How to add 'greater than' operator to an integer

    Hi Tom,

    I'm interpreting your question to mean:
     "How do I set the value range of an integer object type in the property sheet to >=1?"

    If so, here is an example of setting the value ot a person's Age to >=1:

    Select the object type on the NORMA drawing surface.    

    In the property sheet choose one of the integer data types.

    In the value range property put    1..  (NORMA will add curly braces so that the property sheet looks like this:  {1..}   )

    Then when you generate the DDL (e.g. for SQL Server) you will see this:

    CREATE TABLE ORMModel1.Student

    (

    studentNr int NOT NULL,

    age int CHECK (age >= 1) NOT NULL,

    firstName nchar(50) NOT NULL,

    lastName nchar(50) NOT NULL,

    CONSTRAINT Student_PK PRIMARY KEY(studentNr)

    )

    Ken

  • 02-15-2013 13:34 In reply to

    Re: How to add 'greater than' operator to an integer

     Hi Ken,

     I knew it would be something simple! I was trying > 0, >= 0.

     Thanks for the help ^______^

     

Page 1 of 1 (3 items)
© 2008-2014 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service