I think this is a place I can ask this question, because most people here may know both PL_SQL and T_SQL.
As I understand, T_SQL is a set based language, cursor are rarely used, except special cases like administrative tasks etc.
PL_SQL is a procedure based language that use a lot of cursors.
I am new to PL_SQL, and I found a lot of code in our oracle database for stored procedures can be replaced just by using SQL statements. It seems oracle create a lot of cursors, and process it row by row.
It is slow performance, I don't see what the benefits, I know sometimes if you want to log what is the specific row that creates the error, cursor is handy.
Also I know in oracle they have ForAll and Bulk Collections, the cursor mentioned above with DML statement can be converted into new way of coding using ForALL and bulk Collections, but code written by using ForAll and bulk collections usually are much longer and complicated than cursor method. I just don't understand why not just use Plain SQL set based statement to do DMLs in the stored procedure, but to write either cursor or ForALL, Bulk collections.
Can experienced PLSQL and TSQL programmers shed some lights on this?