I have a pretty simple mantra when it comes to developing database software, and I have written this many times over the years:
If you can do it in a single SQL statement, by all means do it in a single SQL statement. Do not waste time, energy, and CPU cycles writing procedural code that will run slower than regular SQL. This question comes up frequently on Ask Tom (asktom.oracle.com), and my answer has always been very consistent. If you don’t have to write procedural code, don’t. If you can erase many lines of procedural code and replace it with a single SQL statement, do so. Less code = fewer bugs; more code = more bugs. Remove bugs by utilizing SQL.
- You should do it in a single SQL statement if at all possible.
- If you cannot do it in a single SQL statement, do it in PL/SQL.
- If you cannot do it in PL/SQL, try a Java stored procedure.
- If you cannot do it in Java, do it in a C external procedure.
- If you cannot do it in a C external procedure, you might want to seriously
think about why it is you need to do it.
Blog with ORACLE related posts (mainly PL/SQL programming) and some personal thoughts
Blog com artigos sobre ORACLE (principalmente sobre programação PL/SQL) e alguns pensamentos pessoais.
2007-02-13
Mantra
O Tom (do asktom.com) na pagina 71 do ultimo Oracle Magazine expõem outra vez a sua mantra já que está sempre a responder .
Categorias / Labels:
Best Practices,
Leituras,
Oracle Blues,
Oracle DB,
PL/SQL
Subscribe to:
Post Comments (Atom)
You might be interested in a small writeup I did on how to setup a really simple Oracle External procedure to run host commands on the server.
ReplyDeletehttp://timarcher.com/?q=node/9