Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Put code inside or outside database?
Randy Harris wrote:
>>Put all the DML logic and query logic in the database using packages (no
>>SQL statements in the application), put everything else (data
>>presentation, user interface, etc) in the application.
>>
>>Kind regards,
>>
>>--
>>Cris Carampa (cris119_at_operamail.com)
>>
>>- We're gonna be like three little Fonzies here. And what's Fonzie like?
>>- Cool?
> > Cris, I wonder if I could trouble you to elaborate a bit. I'm trying to > learn some "best practices." Why do I not want SQL statements in my > application? If I need a query to retrieve an undetermined number of rows, > don't I need to execute the SQL from the application?
Hopefully Cris will respond but I wanted to weigh in on this:
Because SQL not in the database is far harder to debug.
Because SQL not in the database is far harder to tune.
Because, by definition, more bytes need to be moved from client to app server to database on a copper wire.
Your assumption with respect to the number of rows returned is not correct. Return a REF CURSOR or an array.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Fri Apr 08 2005 - 18:51:48 CDT