Expert: PL/SQL procs vs Queries

From: J.W. Parrott <spo_at_interlog.com>
Date: 1996/01/29
Message-ID: <4ehv47$7cm_at_steel.interlog.com>#1/1


Does anyway have any insight into PL/SQL vs. Queries in Oracle?

My friend and I are having a debate regarding this issue. I want to create a series of functions that return values for a specific record and tie these into larger select statements. I feel that in this way, business rules can be broken down and further development can be quick. Functions such as

	getSalary( dt in date) for returning the salray on any given date,
	getLastRaise( dt in date) for returning last raise before a given date, etc

My friend beleives that databases like Oracle are fine tuned to work with large select statements and perform better as a series of such statements rather than calculating one record at a time. He believes that the procedural code behind these functions create a lot of overhead when if they were combined with the larger end resulting query, would be more effecient.

I see his point and belive he is probably right, However, if busines rules and data structures change such that tasks need to be reworked I would prefer to make one change rather than visti all related tasks.

I would think that on some level Oracle translates all its queries into cursors. How much over head is my method of programming and which is generally considered better.

Thanks. Received on Mon Jan 29 1996 - 00:00:00 CET

Original text of this message