Subject Re: [firebird-support] COMPUTED BY between 2 tables
Author Klett
Jason Dodson a écrit :
> Alter Table Table2
> Add MyNewField Computed By ((Select (Table2.Date2 - Table1.Date1) as MyNewField From Table1 Inner Join Table2 on
> Table1.ID_Table1 = Table2.ID_Table2));
>
> Klett wrote:
>
>> Hello,
>> It's my first message on this forum. I apologize for my bad English.
>> Here is my problem.
>> I 've 2 tables
>>
>> TABLE_1
>> ID_Table1 INTEGER NOT NULL,
>> ....
>> Date1 DATE,
>> .....
>>
>> ALTER TABLE Table_1 ADD CONSTRAINT PK_TABLE_1 PRIMARY KEY (ID_Table1);
>>
>> TABLE 2
>> ID_Table2 INTEGER NOT NULL,
>> ID_Table1 INTEGER,
>> .....
>> Date2 DATE,
>> ....
>> ALTER TABLE Table_2 ADD CONSTRAINT PK_Table_2 PRIMARY KEY (ID_Table2);
>> ALTER TABLE Table_2 ADD CONSTRAINT FK_Table_2 FOREIGN KEY (ID_Table1)
>> REFERENCES Table1 (ID_Table1);
>>
>>
>> I would have a COMPUTED BY Field on the Table 2
>> "Date2" - "Date1"
>>
>> Is it possible ?
>> Thanks for any hep
>>
>>
>>
>>
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>> Visit http://firebird.sourceforge.net and click the Resources item
>> on the main (top) menu. Try Knowledgebase and FAQ links !
>>
>> Also search the knowledgebases at http://www.ibphoenix.com
>>
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
> --
> The information transmitted herewith is sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
Jason

Thanks for your help
I succeeded in doing the Computed by Field.
Klett