>> > In tracker case 4212, Vlad Khorsun wrote:
>> >
>> >         It is documented since introducing GTT in v2.1 that
>> > constraints between temporary and permanent tables is forbidden. This
>> requirement is per SQL standard.
>> >
>> > I want to be sure that this is correct (sorry Vlad), cus it seems wrong.
>>
>> 11.8 <referential constraint definition> Syntax Rules
>>
>> 5) The referenced table shall be a base table.
>> Case:
>> a) If the referencing table is a persistent base table, then the referenced
>> table shall be a
>>     persistent base table.
>> b) If the referencing table is a global temporary table, then the referenced
>> table shall be a
>>     global temporary table.
>> ...
>> 6) If the referenced table is a temporary table with ON COMMIT DELETE
>> ROWS specified, then
>>     the referencing table shall specify ON COMMIT DELETE ROWS.
>>
>> > I can see that a permanent table should not be able to refer to a GTT,
>> > but the reverse (a GTT referencing a permanent table) seems entirely
>> > logical and desirable for data integrity purposes.
>>
>>     It is physically impossible to check detail data in all instances of 
>> detail GTT
>> when master record is changed.
>
> First, thanks for the details (BTW, is there a link for the spec)

    AFAIR, SQL standard is not free, so there is no link for free download 
(known
to me). I have draft versions of SQL 2003 and SQL 2008, but i don't remember
where i got them :)

> I understand/appreciate the difficulty of checking the dependent GTTs.
>
> I must admit was wasn't thinking about the impact of an invalidation of the 
> master records, but rather only about the enforcement 
> of the presence of the master when GTT rows are created.
>
> I will point out that, the specs does allow for GTT to reference GTT, which 
> is not what your original comment stated (that a GTT 
> could not have any dependencies/references).

    I meant exactly this, sorry if it was not clear.

Regards,
Vlad 


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to