Focal Point
[SOLVED] SQL PASS THRU

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

February 21, 2011, 03:17 PM
Enigma006
[SOLVED] SQL PASS THRU
When using SQL pass thru is it good to directly apply filters (WF where conditions) on SQLOUT or is it better to save SQLOUT as HOLD and then apply filters? This is performance wise..

Thanks

This message has been edited. Last edited by: Kerry,


8.1.05
HTML,PDF,EXL2K, Active, All
February 21, 2011, 05:21 PM
MathematicalRob
Hi!

As a rule, your filters should be applied at the earliest possible point. So, put as many as you can right in the SQL, then, when you TABLE sqlout, add whatever else you can there.

There are exceptions, which you'll find as you work with your data - sometimes a filter in an SQL statement will produce a sub-optimal execution plan for the SQL, and it will actually end up being more efficient to pull a large data set with SQL and then filter it in WebFocus.

Hope that helps!
Rob


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
February 21, 2011, 05:40 PM
Enigma006
Thanks Rob. I will try that. And can you help me with one thing.


I am passing multiple values from listbox to webfocus procedure which is a SQL query. How to add it as a filter to SQL query. If its one value I don't have any problem. If its multiple, there is problem with quotes etc. Do you have any dialog manager code for this?

Thanks


8.1.05
HTML,PDF,EXL2K, Active, All
February 23, 2011, 02:59 AM
Ramkumar - Webfous
Hi Enigma,

It is good to apply filer values in SQL query itself rather than you do on the SQLOUT.
Thatz the better way for higher performance.

But there are few scenarios you need to do that in WF. As said by Rob is one...

Other one... If you have multiple select parameter in your dashboard, you cant directly assign that to a where clause variable in Query(1 OR 2 OR 3). You need to frame the variables as per the DB need. In such cases that can be done as part of SQLOUT.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
February 23, 2011, 06:54 AM
Tom Flynn
Pass it to SQL SP

Yes, you can pass multiple values to the Stored Proc...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
February 23, 2011, 11:19 AM
Enigma006
Thanks tom. But I figured it out myself. Its somewhat similar to this..thanks all..


8.1.05
HTML,PDF,EXL2K, Active, All