|
|
Inappropriate
|
See Answer
To Email:
Subject:
Note to go along with the question: (Optional, no
more than 1,000 characters)

It depends what the logic is. If you need to do complex manipulation of data already in the database, it is probably better than trying to run sql queries and fetch the data into the middle tie and perform the manipulation in the middle tie, then send the large amount of data back to the database using sql insert or update. On the other hand, you can do to something simple using sql, but you have to write quite a lot of code in stored procedure, why do that.
For stored procedure vs. dynamic sql queries, assuming you are not talking about case where you can call stored procedure within a sql query or you can use dynamic sql inside a stored procedure, dynamic query has a downside (at least in Oracle db), that it has to be compiled if the exact sql string is not used recently (seconds I think) by any session, which could takes some time, and use some system resource. On the other hand, logic in stored procedure is not necessary automatically better.
I think you have to compare approaches based on how easy it is to write the code to do what you want, how easy it is for others to understand and maintain the code, and what is the performance cost in a target database, etc.
Create Date
:
Monday, May 05, 2008
Click here
to improve the Interview Question, Answer and other fields.