Focal Point
SQL Server Stored procedure VS webfocus

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8101088331

July 18, 2005, 04:44 PM
<cwang>
SQL Server Stored procedure VS webfocus
Hi all,

My webfocus reports access SQL server database, In some of my repots I have to use a SQL server view which combined three other views and other two tables to generate reports. In my base tables, each table contains few millions repcords,I don't think this is a very good way to retrive information, but I really don't have any other better ideas to go. I am more concerned about the perfomance for the high volume and table,view join together,Is this possible I can use stored procedures to replace the views I used?
or any other good ideas?

Thanks
July 20, 2005, 04:01 PM
FliPPeR
Sure you can call Stored Procedures, I do that very often...

Ex:

SQL SQLMSS SET SERVER PROD
SET SQLENGINE = SQLMSS
SQL SQLMSS EX Scenarios..GetProjectRDIndirectCostsOverall '&KEY';
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS RESULT
END
July 20, 2005, 04:30 PM
Carol Dobson
If you're good with FOCUS, you can do it all without Stored Proces or views. There's an old post

Efficiencies : WebFOCUS with SQL

If you click on page 37 of this forum, it might be worth reading.

Of course, if you're more comfortable with Stored procs, then that should be your path.
July 27, 2005, 04:06 PM
<cwang>
Thanks for the responses, I will certainly some both of the suggestions.
July 28, 2005, 03:33 PM
EricH
In my experience, you will not get any significant performance improvements by using stored procedures. After all, if you look under the covers, the stored procedure is executing SQL calls against the same tables/views that you are already reporting against anyway.

That said, there will be occasional situations where it is more efficient to break up a single query into multiple calls. In this case you can use stored procedures and/or WebFOCUS logic to break up the calls and control the flow of the report.

As to which approach to take, it's a judgement call...

If there is even the slightest chance that your application may be ported/migrated to a different RDBMS (Oracle, DB2, MySQL, etc), then WebFOCUS is the obvious choice. Otherwise, it depends on your skill & comfort level. If you keep everything in WebFOCUS, your program logic is all in one place and your system should be easier to maintain & debug. However, if you are already comfortable working with stored procedures and you are under a tight deadline, then using stored procedures may work better for you.

EricH