setting an attribute with date data type as identifier

setting an attribute with date data type as identifier

  

I want to set an attribute with date data type as identifier but the option is not showing. Please help me resolve this issue.

Hi Amanda,

You will need to provide a bit more details than you did. What "option" isn't showing? Where do you expect it to show? What did you already try?

In general, when you add an Attribute to a Structure or Entity, there's three ways to set the Data Type:

  1. Service Studio does it automatically. If the name has "Date" in it, SS will make it a Date type, if it detects an Entity name with "Id" at the end it will make it an Identifier for that Entity, etc.
  2. You can select a Data Type from the Data Type property drop down list. This may become unwieldly if you have a lot of Entities.
  3. You can, in the Data Type property input, type the first letter of the data type; repeatedly for the 2nd, 3rd instance etc.

If you cannot find the right data type, then probably it is not referenced. Did you check the references? Does the Entity you want an identifier of appear on the Data tab?

Hi Kilian Hekhuis,

You misunderstood my question.

I have already have an attribute of  the datatype "date"

If I right click that attribute and try to "set it as identifier", I am not able to do it. As you can see in the image below, "set as Identifier" is not accessible. Why? Can't an attribute of data type "date" be set an identifier?

Hi Amanda Soyza,

Primary Key is a simple unsigned integer because there are many cases where there is no perfect candidate for Primary Key. The auto increment allows this column to be automatically filled by the database (and be unique) during inserts 

if you want to create a date as the identifier it will serve as the primary for the table and you cannot add two same dates in the table are you sure about the flow.

Hi Amanda,

Only Integer, Long Integer, Text  and other Identifiers can be set as Identifier. But in general you wouldn't want to set any other attribute than the default AutoNumber Id as identifier, unless you have a foreign key that's also the Id (typically used for extension tables).

As Kirit already said, setting a date field to an identifier doesn't make sense. Why would you want to do that?

Solution

Amanda Soyza wrote:

Hi Kilian Hekhuis,

You misunderstood my question.

I have already have an attribute of  the datatype "date"

If I right click that attribute and try to "set it as identifier", I am not able to do it. As you can see in the image below, "set as Identifier" is not accessible. Why? Can't an attribute of data type "date" be set an identifier?

Amanda,

why do you want a date field to be Identifier? 

Why not keep the Id as Identifier and create an Index to have unique dates on that date field?


Abílio Matos


Solution

Hi Amanda,

Date columns cannot be set as Identifier. Can you explain the instance why you need to use it as Identifier? I am trying to understand your situation so our friends here can help your situation.

Regards,

Edwin