As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I am attempting to create an HTML launch page that employs a ListBox of values. The ListBox was created via a hyperlink on a PushButton control. I am attempting to populate the ListBox using an Embedded Procedure. I copied and pasted the code for the Embedded Procedure from a FEX file. The code was rested in the FEX file and produced the expected result set. The code does not work in the Embedded Procedure. I get an error when running the HTML: launch page...'Error retrieving data'. I isolated the problem to the use of a olus sign (+) in one line of code:
-SET &END_YEAR = &TODAY_YEAR +1;
WebFOCUS does not like the use of a plus sign in the Embededd Procedure code. Has anybody come acroos this issue? Is this a WebFOCUS bug?
Note: The code in the Embedded Procedure does works if employed as an External Procedure.This message has been edited. Last edited by: Kerry,
The embedded procedure runs outside the context of the rest of your procedure/report. Perhaps the value of &TODAY_YEAR isn't known in the embedded procedure?
That said, embedded procedures have rather limited capabilities. Looking at how they work I think that's because the procedure isn't sending the actual TABLE request over. If you check the HTTP requests fired when calling an embedded procedure from your browser, you will see a call to a servlet named RemoteValues with an XML fragment as its parameter.
I have no idea why this was designed like it is, but there you have why it's so limited
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
Thank you for your responses. This is the complete code that is contained in the Embedded Procedure. As I said, the code has been tested by executing it in a FEX file. The tested code did produce the expected result set. I tried blanks/no blanks, before/after the + sign to no avail. The issue definitely is the use of the + sign.
SET HOLDLIST = PRINTONLY
-SET &TODAY = &YYMD; -SET &TODAY_YEAR = EDIT(&TODAY,'9999'); -SET &TODAY_DAYMTH = EDIT(&TODAY,'$$$99/99'); -SET &START_YEAR = &TODAY_YEAR - 1; -SET &END_YEAR = &TODAY_YEAR + 1; DEFINE FILE VEHICLE X_DAY_VAL/A2=EDIT(VEHICLE_ID, '$$99'); END TABLE FILE VEHICLE BY 'VEHICLE.VEHICLE.VEHICLE_START_DATE' NOPRINT BY 'VEHICLE.VEHICLE.VEHICLE_REPORTING_TERM' NOPRINT BY 'VEHICLE.VEHICLE.VEHICLE_ID' BY 'VEHICLE.VEHICLE.VEHICLE_ID' HEADING "" WHERE ( VEHICLE_REPORTING_YEAR GE &START_YEAR ) AND ( VEHICLE_REPORTING_YEAR LE &END_YEAR ) AND ( VEHICLE.VEHICLE.X_DAY_VAL EQ '/0' ) ; ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT XML ON TABLE SET HTMLCSS ON END
paul, edit your signature to say what version you're on. 1) SET &TODAY = &YYMD needs an EVAL. -SET &TODAY = &YYMD.EVAL ; 2) you don't need any of that. type out these system variables, FYI. &DATEYY &DATEYYM &DATEM Buy a copy of the webfocus keysheet...they're all in there. 3) -SET &START_YEAR = &DATEYY - 1 ;
If you use IF statements rather than WHERE statements (which you can b/c they'are all comparing to literals), it'll move alot faster.
take the HEADING stuff out of your fex. TABLE FILE VEHICLE BY VEHICLE_ID ..your filters ON TABLE PCHOLD END ...is all you need. try it.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
-SET &START_YEAR = &DATEYY - 1; -SET &END_YEAR = &DATEYY + 1; DEFINE FILE VEHICLE X_DAY_VAL/A2=EDIT(TERMS_ID, '$$99'); END TABLE FILE VEHICLE BY 'VEHICLE.VEHICLE.VEHICLE_ID' WHERE ( VEHICLE_REPORTING_YEAR GE &START_YEAR ) AND ( VEHICLE_REPORTING_YEAR LE &END_YEAR ) AND ( VEHICLE.VEHICLE.X_DAY_VEHICLE EQ '/0' ) ; ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT XML ON TABLE SET HTMLCSS ON END
This code works in FEX file and gives me the expected result set.
It does not work as an Embedded Procedure.
The problem is the + sign.
If you take the + sign out of the code in the Embedded Procedure you get a result set - not the one you want, but no retrieval errors.
did you try what Francis suggested? Francis knows all... when he makes a suggestion, go with it. try also &DATEYY.EVAL - 1 ;
try also DEFINE FILE VEHICLE STARTYEAR/I4 WITH VEHICLE_ID = &DATEYY.EVAL - 1 ; ..etc then change your IF's to WHERE (VEHICLE_REPORTING_YEAR GE START_YEAR ) etc
also try not embedding the fex, call it as an external.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Personally, I wouldn't "move away from using external procedures". People have discussed here several issues with embedded procedures, including issues with chaining.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Ultimately, the embedded procedure gets sent up the the Reporting Server and executed there. In some contexts, + is an escape of a blank, and I suspect that's what's hapening here -- the "+" is being translated back to " ", and
-SET &END_YEAR = &DATEYY 1;
doesn't parse very well.
If you really needed to work around that,
-SET &END_YEAR = &DATEYY - (-1);
would do it.
But in general, I vote for stored procedures -- why complicate the execution path, adding interpretation of XML and execution of javascript code just to present the code to the server; and impact analysis is unfeasible when the code is embedded in an HTML file.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005