On an insert event in a table, i need to fetch some data in a file using C++ API and send that file to client.
So currently my plan is to Check the " After insert" event using a sql trigger and call the C++ exe from the trigger.
I found in many places that its not advisable to call an exe from a trigger. But i believe in my case it should not be a big issue as my exe is not going to update anything, rather it will just fetch some data and generate a pipe delimited file having those data.Please let me know if this has any limitations.
Question:
- What are the steps i should follow to call an exe from a trigger?
- If i call my exe from the trigger, should it cause any types of issues in database like database hang?
Note: A better approach comes to my mind is: We have our own C++ APIs using which i can connect to Database.So i can put a logic in C++ which should have a daemon logic to check the table every time and generate the file once an insertion happens in table.But the problem here is , my client don't want to have a daemon process which needs constant monitoring and increase the maintenance work.They are suggesting to go with an approach where it should run the application only when the insertion event happens.
Please help me on this whether i should go for trigger approach to call the exe from there. Also please let me know for any better approach.