Merge records referenced by FK
------------------------------

                 Key: CORE-4408
                 URL: http://tracker.firebirdsql.org/browse/CORE-4408
             Project: Firebird Core
          Issue Type: New Feature
            Reporter: Evelyne Girard
            Priority: Trivial


It would be nice to be able to merge a record referenced by Foreign Keys with 
another and have the server performing a cascade update instead of having to 
update all the tables referencing this record and then delete the referenced 
record.

Example : 
Table Patient (Patient_ID integer not null primary key);
Table Visit (Visit_ID integer not null primary key,
Patient_ID integer not null,
constraint FK_Visit_Patient foreign key (Patient_ID) references 
Patient(Patient_ID) on update cascade on delete no action);

if Patient_ID 2 is effectively the same patient as Patient_ID 1 and I want to 
merge those two records, I have to do:
Update Visit set Patient_ID = 1 where Patient_ID = 1; --And the same on the 
dozen of dependant tables
Delete from Patient where Patient_ID=2;

If this could be done with one action (something like "merge patient set 
patient_id=:NewValue where Patient_Id=:OldValue) it would save having to create 
a Stored Procedure to execute each updates on then foreign keys...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to