Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Constraint/ForeignKey
Sun, Nov 12 2006 5:00 AMPermanent Link

"Bodo Reinecke"
Hallo
I use D2006 and DBISAM 4.24 /ServerApp.

I use tow Table : e.g.

Table A
               Field ID (Integer)  PK
               Field Name (String)

Table B
               Field TA_id (Integer) PK
               Field ID (Integer)
               Field NameV (String)

I only use  TDBISAMSession,TDBISAMDatabase,TDBISAMQuery.

Now my Question is there any way to make a Constrain form Table A (ID) to
Table B (TA_ID).
When i will delete a dataset in Table A and there is a Dataset in Table B
with the same ID then it will not to go.??
Sorry for my  my bad English and i hope you understand my Question.
THX Bodo


Sun, Nov 12 2006 6:36 AMPermanent Link

Eduardo
Bodo

In DBISAM 4.X there is not a Referencial Integrity and therefore you can´t set a constraint to do this. But you
can, of course, code it manually.

Eduardo
Mon, Nov 13 2006 4:59 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Bodo,

<< Now my Question is there any way to make a Constrain form Table A (ID) to
Table B (TA_ID).
When i will delete a dataset in Table A and there is a Dataset in Table B
with the same ID then it will not to go.?? >>

You cannot do it declaratively like most databases, but you can do so via
the triggers in DBISAM:

http://www.elevatesoft.com/dbisam4d5_customizing_engine.htm

See the section entitled "Triggers" for more information on creating
triggers in the engine.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image