vasanth
I'm new here

Creation of Composite Primary Key

Hello,

Is there way to implement the composite primary key in the First Spirit (Java Client)??

Thank You,

Vasanth.

0 Kudos
4 Replies
broszeit
I'm new here

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

0 Kudos

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

0 Kudos

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

0 Kudos

Thanks a lot rouven !!!!!!!!!

0 Kudos