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 .

I have a pretty simple mantra when it comes to developing database software, and I have written this many times over the years:
  • 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.
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.

1 comment:

  1. 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.

    http://timarcher.com/?q=node/9

    ReplyDelete

Os comentários são moderados.
The comments are moderated.