473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

enum data type

144 100+
hi,

can we have a enum datatype for a column in a table?
i need to store the position of an employee in the 'employee' table. there'll be just 5 positions available such as 'cashier, storage, admin, owner, etc..'.

for some reason i couldn't create another table to hold the position information and have a foreign key in the 'employee' table to that position table.

i thought i could use an enum data type. i want to hear from you guys, what datatype will suit this requirement. any comment and recommendation will be appreciated.

Thank you.
Oct 22 '08 #1
2 3171
ck9663
2,878 Expert 2GB
What error are you getting?

Try:

1. Create your POSITION table. Use tinyint as your PositionID (PK).
2. Insert records to your POSITION table.
3. Modify your EMPLOYEE table.Add a new column PositionID. Do not make it an FK yet.
4. Update your EMPLOYEE table for the proper PositionID based on POSITION table.
5. Make the Employee.PositionID as FK to Position.PositionID

Happy coding!

-- CK
Oct 22 '08 #2
thesti
144 100+
hi,

thanks for the reply.
actually the reason that i couldn't create the Position table is not because errors while creating the Position table, it's the customer demand. i think i'll try to discuss this with the customer.

Thank you.
Oct 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: Glenn Venzke | last post by:
I'm writing a class with a method that will accept 1 of 3 items listed in an enum. Is it possible to pass the item name without the enum name in your calling statement? EXAMPLE: public enum...
2
by: mrhicks | last post by:
Hello all, I have a question about enumerations. Within some requirements data passed back a certain bit field is defined by three bits then in another section the bit field is defined as 4...
21
by: Andreas Huber | last post by:
Hi there Spending half an hour searching through the archive I haven't found a rationale for the following behavior. using System; // note the missing Flags attribute enum Color {
5
by: Barry | last post by:
Hello, In VS2003, I tried using an enum and setting it into a field in a datarow. It seems as if the datatype of the field in the row determined what went into the field. If the datatype was...
34
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
35
by: dtschoepe | last post by:
Greetings. I am working on an assignment and can't seem to get the right concept for something I'm attempting to do with enum data types. I have defined the following in my code: enum color...
3
by: hufaunder | last post by:
Imagine you have a charting library that can draw lines, bars, floating bars, bands, etc. Lines and bars need only one input. Floating bars and bands need two inputs. There are two approaches: ...
10
by: Charlie | last post by:
I tried to post this before and I apologize if I am repeating myself, but I do not see the post anywhere. But anyway, I have a file, data.c, where I define all of my global variables. I then...
12
by: Charlie | last post by:
I have a file, data.c, where I define all of my global variables. I then have a header file, data.h, which I include in every file in which I reference all of the variables defined in data.c. ...
4
by: jonpb | last post by:
The documentation for the "is" keyword says: An is expression evaluates to true if the provided expression is non-null, and the provided object can be cast to the provided type without causing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.