on 08-06-2014 11:25 AM
Hi,
I am trying to create a data model using HDBDD. I am trying to incorporate foreign keys where the referencing table should not allow an entry if the foreign key is not present in the referenced table.
@Schema : 'TEST
context STATUS_ENTRIES
{
@Catalog.tableType : #COLUMN
entity status
{
key status_id : Integer;
description: String(10);
} ;
entity ref_status
{
key ref_status_id: Association [1,1] to status{status_id};
description: String(10);
};
};
So what i am trying to do here is to create a table named status which has the main status entries with key field as status_id and another table whose key ref_status_id is referencing status_id from status table. However when i insert ref_status id's in the "ref_status" table that are not present as status_id's in "status" table, it lets the query run successfully. Can someone let me know what i'm doing wrong?
Thanks,
Timothy
Hi Timothy,
The reason why you can insert "ref_status" successfully is that although the association means "foreign key" in HDBDD, the activation of HDBDD will not generate the real "foreign key" in database. You can check that with
SELECT * FROM REFERENTIAL_CONSTRAINTS;
to select all foreign keys in your database. However, you cannot find it related with your scenario. I also don't know how to generate the real "foreign key" when using association in HDBDD.
Best regards,
Wenjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.