- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Creation of Composite Primary Key
Hello,
Is there way to implement the composite primary key in the First Spirit (Java Client)??
Thank You,
Vasanth.
- Labels:
-
Developers
-
Knowledgebase
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
it is not possible to implement composite primary keys in FirstSpirit.
How and why do you want to use them? Maybe there is another way to design the database structure which fits your needs?
Regards,
Rouven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Rouven,
I have a table in my schema and i want to create composite key in the sense combination of two column as a primary key. So that combination won't be repeated again.
Eg:
Table
===========
Student Name| Student Number
-------------------------------------------
Demo | 123456
In my requirement i have make sure that no duplicates of the two records.
Thank You,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Vasanth,
if you create the database within FirstSpirit the primary key will always be the column "fs_id".
You can use constraints to ensure that those columns are unique. Those constraints must be set manually on the database. The way you define the constraints depends on the database you are using. The documentation of the particular database helps to create them.
If you have configured your database with constraints on the columns the editor will get an exception if he tries to create an entry where this combination of student-name and -number already exists.
Regards,
Rouven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot rouven !!!!!!!!!

