dbTalk Databases Forums  

Function to check referential status of a record in a table

comp.databases.mysql comp.databases.mysql


Discuss Function to check referential status of a record in a table in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cell
 
Posts: n/a

Default Function to check referential status of a record in a table - 10-04-2010 , 03:12 AM






Dear all,

I have several tables with foreign key constraints.

What I want to achieve is if a record is referred by any other tables,
the record should not be allowed further modification and a copied
record should be inserted for update instead.

So I want to ask whether there exists a function to do this in Java or
PHP, or normally how should one do this?

Thanks!

Reply With Quote
  #2  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: Function to check referential status of a record in a table - 10-04-2010 , 10:25 AM






On Mon, 4 Oct 2010 01:12:10 -0700 (PDT), cell wrote:
Quote:
Dear all,

I have several tables with foreign key constraints.

What I want to achieve is if a record is referred by any other tables,
the record should not be allowed further modification and a copied
record should be inserted for update instead.

So I want to ask whether there exists a function to do this in Java or
PHP, or normally how should one do this?
You'll have to write your own.

All the information about that is in the INFORMATON_SCHEMA though, and
the TABLE_CONSTRAINTS table will be where to start looking.

--
100. Finally, to keep my subjects permanently locked in a mindless
trance, I will provide each of them with free unlimited Internet
access.
--Peter Anspach's list of things to do as an Evil Overlord

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.