Note that there are some explanatory texts on larger screens.

plurals
  1. POIdentifying the edited columns in the database
    primarykey
    data
    text
    <p>At the beginning the application have an <code>admins</code> and <code>employees</code> and <code>records</code>. </p> <p>The records table has many columns than can be changed by any employee. However, this change can not be submitted. When the admin approve for an edit the record will show up again in the system. </p> <p>I was trying to identify the column name and the value, and send it to another table using triggers on UPDATE.</p> <p>So when the employee edits any record, the record will be disabled in the system. Also the admin will be able to know which values has been changed. </p> <p>Is this possible in databases ? </p> <pre><code>Records Table ------------------------------------------------------------------- record_id record_name record_serial record_active ------------------------------------------------------------------- 1 something 5151 YES </code></pre> <p>When an update happens to the record_serial, such as from 5151 to 9844 I need to do this.</p> <pre><code>Records_changes ------------------------------------------------------------------- change_id record_col record_old_val record_new_val ------------------------------------------------------------------- 1 record_serial 5151 9844 </code></pre> <p>At the same time </p> <pre><code>------------------------------------------------------------------- record_id record_name record_serial record_active ------------------------------------------------------------------- 1 something 9844 NO </code></pre> <p>I can do it using my application, but if there is anyway to do it using the database it would be much nicer.</p> <p><strong>I will use this to track the changes, and also create a history for the records old values.</strong></p> <p>I am using <code>MySQL</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload