Page 1 of 1

can rollback be applied for stored procedures?

Posted: Wed 28 May 2008 08:21
by charbel
hey there,
im calling a stored procedure on edit event of a specific table, and after that this table may be canceled which will call rollback . does the stored procedure executed will be rollback?
if so what should my code contains?

Posted: Wed 28 May 2008 14:30
by Dimon
In order to rollback of the stored procedure executing, the TMyStoredProc and TMyTable or TMyQeury should have the same connection. Also the FetchAll property of these components should be set to True.
Call the TMyConnection.StartTransaction method before editing table and executing stored procedure.
Call the TMyConnection.Rollback method to rollback the changes.