Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
How to delete orphaned detail records |
Thu, Nov 13 2008 8:33 PM | Permanent Link |
Darrell | Hi ~
how can I delete orphaned detail records, e.g. invoice detail records for which the invoice header record has been deleted? These records are linked via the invoice_id field. Thanks Darrell |
Thu, Nov 13 2008 9:43 PM | Permanent Link |
"Robert" | "Darrell" <darrell.funk@the_funks.ca> wrote in message news:3D2AA825-168E-49AF-8F39-2C930AE0714A@news.elevatesoft.com... > Hi ~ > > how can I delete orphaned detail records, e.g. invoice detail records for > which the > invoice header record has been deleted? > These records are linked via the invoice_id field. > select invoice_id, master_id from details left outer join master on master_id = invoice_id where master_id = null gives you the orphans. Use that as the subquery for your deletes. Robert |
Thu, Nov 13 2008 9:46 PM | Permanent Link |
Darrell | Thanks!
|
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |