• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to find child table names that need to be deleted?

 
pete johnson
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

i have a master table and there are a few child tables. i need to
delete a record in the master table, but i dont want to delete
dependent child records by cascading. i want the program to catch
JDBC exception and then to display an alert
of asking users to delete child records manually. i dont want "soft delete"
(using a true/false flag).

to better inform users about where child records reside,
i want the table names to be displayed in the alert. is any
general way for extracting child table names from JDBC exceptions?

thanks for your advice and information!

pete
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure of this, but I guess this should help you with your problem.

[ October 10, 2005: Message edited by: Annie Smith ]
 
pete johnson
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using JTDS driver. after looking at the nested exceptions due to deleting master records that have child records, i found that the nested
exceptions actually do have the names of the tables that have child records. i can extract such information. not quite sure it is true of
other JDBC drivers.

thanks for your input!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic