Comment by hombre_fatal

4 months ago

People don't do that because when you're writing insert/update queries, you tend to want to write logic based on the value of intermediate results, and also you can't return tabular data from a DO block (they operate as a function returning void).

You also can't use parameterized values like $1, $2.

It seems more niche than you're suggesting. Though I wish people would write app layer pseudocode to demonstrate what they are referring to.

In a plsql block you can use parameters, ref cursors or arrays to return tabular data and do if/then/else/while logic.