Thursday, February 19, 2009

ORA-30926: unable to get a stable set of rows in the source tables

Wow, now this was a perplexing situation.
Calling a procedure which executes 2 merge statements, almost identical, yet only the second one was returning the error message. I really have to thank Oracle for their descriptive error messages on this one, took a little bit of searching but managed to get it sorted.

Seems merge statements only like 1:1 or 1:0 matches and doesn't handle 1:many so updating a master record with multiple children (monthly payments) is a no go. Luckily slapping it in a loop that issues a merge for every month does the job and makes me go home happy.

God bless fast fingers and good resources.

Wednesday, February 18, 2009

Commits in your code

Put them in your frakking code, not in the backend PL/SQL Function or Procedure.
What happens when something goes wrong and you need to rollback ?? You can't because you insisted on having the commit/rollback functionality removed from you because you can't use a connection manager correctly.

For the love of all things holy, learn where best to manage from.

/rant off