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 have an HTML page with 3 parameters (first name, last name, barcode). I want the user to be able to type in either one but not necessarily have to type in all 3. The ideal is that the user will type in only the barcode, however, if they do not have that information I want them to be able to type in the first and/or last name. When I type in the first name or the last name, I get the following:
(FOC1400) SQLCODE IS 102 (HEX: 00000066) XOPEN: 42000 : Microsoft SQL Native Client: [42000] Incorrect syntax near ')'. [42000] : Statement(s) could not be prepared. [] Deferred prepare could not be completed. L (FOC1406) SQL OPEN CURSOR ERROR. : INPUT_TEST
When I type in all 3 I get the output I want to see OR when I type in JUST the barcode, which is the last parameter listed. Any thoughts/ideas about this?
Thanks.This message has been edited. Last edited by: DMA,
WebFOCUS v. 7.6.8 || Windows XP || Format Output: HTML, PDF, EXCEL
Posts: 57 | Location: NYC | Registered: November 13, 2008
-* File input_test.fex -SET &ECHO = 'ALL'; SET BYDISPLAY = OFF -DEFAULT &FIRST_NAME = 'FOC_NONE' -DEFAULT &LAST_NAME = 'FOC_NONE' -DEFAULT &BARCODE = 'FOC_NONE' -* DEFINE FILE INPUT_TEST GDATE/MtDYY = HDATE(DATE, 'MDYY'); GYEAR/YY = GDATE; DRILLMON/MYY = GDATE ; GMONTH/MtYY = GDATE ; GQUARTER/QYY = GDATE ; END -* TABLE FILE INPUT_TEST PRINT BARCODE AS 'Barcode' FINES/D12.2!D AS 'Fines' -* BY FIRST_NAME AS 'First Name' BY LAST_NAME AS 'Last Name' BY GDATE AS 'Date' WHERE FIRST_NAME EQ ('Denise') OR LAST_NAME EQ (' ') OR BARCODE EQ (' '); END (FOC1400) SQLCODE IS 102 (HEX: 00000066) XOPEN: 42000 : Microsoft SQL Native Client: [42000] Incorrect syntax near ')'. [42000] : Statement(s) could not be prepared. [] Deferred prepare could not be com : pleted. L (FOC1406) SQL OPEN CURSOR ERROR. : INPUT_TEST
WebFOCUS v. 7.6.8 || Windows XP || Format Output: HTML, PDF, EXCEL
Posts: 57 | Location: NYC | Registered: November 13, 2008
I assume your WHERE statement code looks like this:
WHERE FIRST_NAME EQ ('&FIRST_NAME') OR LAST_NAME EQ ('&LAST_NAME') OR BARCODE EQ ('&BARCODE');
First, I would code the WHERE statement as rfbowley suggested, but, more importantly, you have to learn what the FOC_NONE does: If there is a FOC_NONE value in a lone of WebFOCUS code, the whole line of code is suppressed - this means if the user only entered 'Denise', the WHERE statement would be suppressed and ignored as there is a 'FOC_NONE' value elsewhere in the line of code.
This is what I would do: create a Dialogue Manager variable for the WHERE statement, bur before I show you how, are you sure you want OR clauses? Shouldn't be AND if the FIRST and LAST names were entered?
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
Yes, that is what my WHERE statement is. Ok re: FOC_NONE, but why is it then that the statements still do not work when I separate them like this: WHERE FIRST_NAME EQ ('&FIRST_NAME'); WHERE LAST_NAME EQ ('&LAST_NAME'); WHERE BARCODE EQ ('&BARCODE');
I have other reports where if there is nothing chosen from the drop-down menu, the default (FOC_NONE) will kick in and that where statement will be ignored. Is it because it is a drop-down menu and the user is not manually entering text?
Also, I can do AND instead of OR for first and last name.
Thanks, Denise
WebFOCUS v. 7.6.8 || Windows XP || Format Output: HTML, PDF, EXCEL
Posts: 57 | Location: NYC | Registered: November 13, 2008
I tried your suggestion except I changed AND to OR in my WHERE statement and I get the following:
ERROR AT OR NEAR LINE 40 IN PROCEDURE input_test_summary_copy (FOC002) A WORD IS NOT RECOGNIZED: OR BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
Thanks
WebFOCUS v. 7.6.8 || Windows XP || Format Output: HTML, PDF, EXCEL
Posts: 57 | Location: NYC | Registered: November 13, 2008
Using an OR with this will be very tricky. When I said replace your current WHERE statements I meant use &WHR1.EVAL &WHR2.EVAL &WHR3.EVAL The statements will be blank if the options were not chosen. The .EVAL will force the &variable inside the &WHR to be evaluated as well as the &WHR itself.
If you are going to use an "OR" condition, you have to test for it before building your &WHR statements. You don't want to end up with OR BARCODE EQ '&BARCODE' as your WHERE without a LASTNAME or FIRSTNAME condition.
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007