Subject Re: [firebird-support] Foreign Key / Referential Integerity
Author Martijn Tonies
Hi,

> This may seem like a very basic question but what is happening is not what
I expected, as follows:
>
> Table1
> Client_ID Primary Key
>
>
> Table2
> Policy_ID Primary Key
> Client_ID Foreign Key constraint
>
>
> I expected that when I added a record to Table2 its Client_ID field would
be automatically
> populated with the Client_ID from Table1.

Why? With what CLIENT_ID? How do you picture this
to work?

Imagine:

(Table1)
Client_ID
-----------
1
2
3
4
5
6
7

Now, add a record to Table2 - what gets inserted in Client_ID?

> This is not happening - Client_ID value remains null.
>
> I am using D7, what am I doing wrong or do I need to turn on (whatever) or
> is my understanding just incorrect.
>
> Thanks....

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com