title: update table with primary key , which is used as foreign key in many child tables
body: <p>I want to update a table(using mysql)through java.  </p>
  
  <pre><code>I have a Test table with structure
  
  id(pk)  name address
  </code></pre>
  
  <p>And another tables </p>
  
  <pre><code>Practice with following structure
  
      p_id  id(fk)   branch
  </code></pre>
  
  <p>Now I want to update Test table, but as per foreign key constraints I will get foreign key constraint that</p>
  
  <blockquote>
    <p>"Cannot delete or update a parent row: a foreign key constraint fails</p>
  </blockquote>
  
  <p>" as it is using in child table also.
  So how can still update my Test table if I want to update it?</p>
  
  <p>I am trying in this way.</p>
  
  <pre><code>UPDATE Test SET  Test.id=1,NAME='XYZ'
  </code></pre>
  
  <p>So should I need to remove foreign key constraints and then update my table as i want and again reapply 
  these constraints again?</p>
  
  <p>How should I update my Test table in such cases?</p>