Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Complex Type Indentifier

Status
Not open for further replies.

milage

Programmer
Jul 13, 2001
58
US
Hi,

I have a hierarchical set of types from which I am implementing tables.

Person
|
User ----- Employer
|
Employee ----- Contact Person

I am trying to create a autonumber column as the identifiying column. But I cannot use the usual method for tables of:

GENERATE ALWAYS AS IDENTITY(START WITH 1,INCREMENT BY 1)

as you can not define this sort of thing within the type definition and you cannot add columns to a table which has been created from a type?!

Therefore, I am considering using the system generated unique object IDs for the indentifying column. However, this is a Varchar(16) value which is rather untidy and unmemorable as it will act the the Employee / Employer / Contact Person IDs I would prefer this to be an integer value.

Is there anyway of making the system generate a sequential value that is an integer as the identifier or is there another way of doing this that I just haven't heard of?

Thanks in advance

Robert Miles
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top