Focal Point
[SOLVED] How do I call a Oracle stored procedure using ref cursors in WebFocus?

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

June 01, 2017, 02:35 PM
RichM
[SOLVED] How do I call a Oracle stored procedure using ref cursors in WebFocus?
I am using Oracle 10g and WebFocus AppStudio.


So I have an Oracle stored procedure. I want to create a report using WebFocus. How do I call the stored procedure.

This is what my Web Focus code looks like now:


SQL SQLORA SET SERVER CPMDEV

SQL SQLORA EX CPMDEV.WF_LONG_DISTANCE_REPORT;

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS SQLOUT

END

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
June 01, 2017, 02:57 PM
David Briars
Our standard is to create .mas/.acx files for the stored procedure using the WF GUI Synonym Builder.

The .mas created does a nice job of defining/describing the required filters (INPUT) and columns you can report from (ANSWERSET).

Once the meta data is created use your normal TABLE FILE command to create your report.
June 01, 2017, 02:58 PM
Tom Flynn
Add END after the SP call, and, don't use the same name for your HOLD file:

SQL SQLORA SET SERVER CPMDEV

SQL SQLORA EX CPMDEV.WF_LONG_DISTANCE_REPORT;
END

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS SQLOUTX
END

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
June 07, 2017, 06:10 AM
Hank W.
Make sure their schema is CPMDEV, if the stored procs are in another schema that you can access, even if in Oracle you "can" call them from CPMDEV, if they reside say in CPMPRC, you need to connect to CPMDEV, but call CPMPRC.WF_LONG_BORING_REPORT

Signed as 'spent a day trying to figure this out'


Cheers,
H.

WebFOCUS 8.1.05M
Oracle 11g - DB2
RedHat
June 07, 2017, 06:14 AM
Hank W.
I warmly second David's method of creating masters. Even if you don't use them for a reason or the other, it is a *very* handy reference for the input/answerset. Especially if the proc's aren't nicely available with what connections you have. Or forbid they differ slightly between environments...


Cheers,
H.

WebFOCUS 8.1.05M
Oracle 11g - DB2
RedHat