OracleCommand command, ExecuteNonQuery issue

前端 未结 4 1095
难免孤独
难免孤独 2021-01-20 03:28

I have to clear certain tables in the oracle database however when I\'m having issues with running the following code

public static void ClearDataTables(ILis         


        
4条回答
  •  囚心锁ツ
    2021-01-20 03:59

    I would probably write a stored procedure that does all of the deletions or truncations and invoke the SP once, rather than have a loop client-side.

    EDIT: It would also be better not to create the command object inside the loop. Create it once outside the loop with a table-name parameter, and then invoke it feeding it a different parameter value with each iteration. But the SP is to be preferred.

提交回复
热议问题