Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Stored Procedures 1

Status
Not open for further replies.

sylvias

MIS
Nov 5, 2002
5
0
0
US
What are some of the advantages and disadvantages of writing Crystal Reports using stored procedures?
 
One advantage is speed. Complex formulas can be processed on the server instead of the report.
 
Many complex functions can be performed on the database server by assuring that you have SQL pass through from Crystal and when using SQL Expressions in Crystal as well.

Generally the advantage to an SP is that it has a precompiled execution plan, the gain that this affords is dependent upon many things, there isn't a generic statement that applies.

One of the disadvantages to Stored Procedures is that they don't lend themselves well to Joins, and you lose control over parameters (they come from the SP itself, and are predefined.

If you have a SQL statement, try creating a View from it, and then an SP, if it's a large database, and the SQL takes quite some time to execute, you'll probably find that the View is very close to the same speed as the SP.

Writing good SQL, making sure that you're taking advantage of indexing, assuring that you're not doing full table scans, these are much more important issues than simply using an SP over a View.

-k
 
Another disadvantage is that you cannot call another stored procedure within the stored procedure (Oracle). Advantage, query may change but the ref cursor if built on a record can still hold same data
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top