Possible Duplicate:
How to create id with AUTO_INCREMENT on Oracle?
I am creating my first application that uses the Entity Framework to access data in an Oracle Database. The Database consists of 16 different related tables. So far I have created a prototype database and loaded some sample data using Oracle SQL Developer. The application is successfully reading the data from the selected tables as well as the related tables.
Now it is time to start adding data from the application. We have had several discussions about how to do that. From the examples I have seen this process seems straight-forward but I do have a question regarding Primary Key generation.
For most (if not all) of the Tables, the Primary Key will be a number with no significance other than i's unique use as a relational Key. This is because the many of the records have no specific field in them that is guaranteed to be unique. The question that comes up is how that Key is generated.
For databases I have worked with before, there was a concept of an auto-increment field type that can be used so the key would be automatically created by the Database. I have been informed by the DBA that Oracle does not have an auto-increment field type. He told me Oracle can support the Key Generation using a Sequence but that would need to be done in a Stored Procedure. On the other hand I am getting major push-back on the use of Stored Procedures. The general feeling is that none of the information on Entity Framework indicated this is needed and that Entity Framework should eliminate the need for Stored Procedures.
Can anyone clarify what I do (or what happens) regarding the Primary Key when I add a record to a Oracle Table using the Entity Framework?