Hi Sonali Farakate,
The script for creating the History table along with triggers is completed.
I have attached the script in this Jira. Also, there are inline comments for using that query.
Create_Trigger_and_HistoryTable_MYSQL.sql
-------------------------------------------------------------------------------------------------
Naming Conventions :
For eg :
Main Table - Communication
For this below will be the outcome from the script :
History table - Communication_History
Triggers Name - trg_Communication_insert, trg_Communication_update, trg_Communication_delete
-------------------------------------------------------------------------------------------------
Below are some changes that I have done and impediments that I'm facing :
Changes Server Level :
Disable - secure-file-priv option - As we are writing out queries into a file and not creating directly, this feature needs to be disabled. I have disabled it for local server and will disable for rest of environments as required.
Impediments :
Queries are written into a file: As of now, we cannot have the drop and exists statements in a dynamic query as it is not a feature in MYSQL.
We have to change the path for writing out the queries in the file which will give us all the statements. If we want to pass the path as variable and parameter to SP, the query needs to be a prepared statement which will take time with analysis.
We can have this in the further scope of development. Please review the script and let me know if any queries.
Regards,
Rushikesh
CC - Rohan J Khandave Samir Satya
Hi Sonali Farakate,
The script for creating the History table along with triggers is completed.
I have attached the script in this Jira. Also, there are inline comments for using that query.
Create_Trigger_and_HistoryTable_MYSQL.sql
-------------------------------------------------------------------------------------------------
Naming Conventions :
For eg :
Main Table - Communication
For this below will be the outcome from the script :
History table - Communication_History
Triggers Name - trg_Communication_insert, trg_Communication_update, trg_Communication_delete
-------------------------------------------------------------------------------------------------
Below are some changes that I have done and impediments that I'm facing :
Changes Server Level :
Disable - secure-file-priv option - As we are writing out queries into a file and not creating directly, this feature needs to be disabled. I have disabled it for local server and will disable for rest of environments as required.
Impediments :
Queries are written into a file: As of now, we cannot have the drop and exists statements in a dynamic query as it is not a feature in MYSQL.
We have to change the path for writing out the queries in the file which will give us all the statements. If we want to pass the path as variable and parameter to SP, the query needs to be a prepared statement which will take time with analysis.
We can have this in the further scope of development. Please review the script and let me know if any queries.
Regards,
Rushikesh
CC - Rohan J Khandave Samir Satya