Focal Point
Wildcard parameter value not returning data.
June 04, 2007, 07:08 AM
hitenWildcard parameter value not returning data.
Wildcard parameter value not returning data.
When using ‘$*’ on a HTML parameter page no data is returned, the lines of code below have been used in the procedure. Using WebFOCUS 7.1.3.
This has worked for other reports, with dropdown boxes or normal text boxes.
Using a parameter value that exists in the data returns data within the report.
-DEFAULT STNUMB ='$*';
-SET &STNUMB = IF '&STNUMB.EVAL' EQ 'FOC_NONE' THEN '$*' ELSE '&STNUMB.EVAL';
WHERE ( STUDYEARNAME.LAST_NAME EQ '&LASTNM' ) AND ( STUDYEARNAME.FIRST EQ '&FIRSTNM' ) AND ( STUDYEARNAME.DOB EQ '&DOBIRTH' ) AND ( STUDYEARNAME.ST_NUMBER EQ '&STNUMB' ) AND ( STUDYEARNAME.COURSE_CODE EQ '&COURSE' ) AND ( STUDYEARNAME.SHORT_TITLE EQ '&CTITLE' );
Does anyone know how I can get this to work?
Thanks in advance to anyone that can help.
Prod: WF 7.6.1 platform Windows, databases: msSQL2000, msSQL2005, IE6
June 04, 2007, 07:45 AM
Tony AHiten,
I guess that you are using a combo box on your launch screen for the population of the &STNUMB value?
How long is the ST_NUMBER field within your data and also what format? If it alphanueric then your test "should" function OK providing that the -SET &STNUMB is functioning.
Issue a -SET &ECHO=ALL; at the top of your report fex and run the report in HTML output. When the report is shown, right click and choose View Source from the context menu options. This will show you the HTML source. Now scroll down right to the bottom and then work your way upwards until you see the FOCUS code for the -SET &STNUMB.
My guess is that this code is being ignored because of the FOC_NONE test (it's what WF does) so my advice would be to scrap changing the value to '$*' so that you are passing the FOC_NONE value onwards (providing your ST_NUMBER is eight chars or longer
) and then change your selection tests to have each component on a seperate line -
WHERE ( STUDYEARNAME.LAST_NAME EQ '&LASTNM' )
AND ( STUDYEARNAME.FIRST EQ '&FIRSTNM' )
AND ( STUDYEARNAME.DOB EQ '&DOBIRTH' )
AND ( STUDYEARNAME.ST_NUMBER EQ '&STNUMB' )
AND ( STUDYEARNAME.COURSE_CODE EQ '&COURSE' )
AND ( STUDYEARNAME.SHORT_TITLE EQ '&CTITLE' )
The advantage of this is that when WF encounters the FOC_NONE value it ignores the whole line therefore only the AND ( STUDYEARNAME.ST_NUMBER EQ '&STNUMB' ) line should be ignored and your request should return all values for ST_NUMBER.
Of course one downside of this is that if your very first test is comparing against a value of FOC_NONE then WF will ignore it and then encounter the AND of the next line. This will cause WF to throw an error as it encountered an AND without a WHERE, but that is easily fixed
.
Good luck
T
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
June 04, 2007, 10:00 AM
LeahAs TONY A says,
Try breaking up the Where statement to two where statements. If you want ALL (FOC_NONE) to work on the STNUMB then you would have just the where with the &STDNUM and then the rest of the selection on the second where to get what you want. Assuming here you want to ignore the STDNUM selection if ALL is included. We just went through getting this to work. You wouldn't need the dialog manager check/set then.
It seems if the FOC_NONE is used in a where clause, the product ignores any other selection included in that clause.
Leah
June 04, 2007, 11:20 AM
JB2003Hiten,
We had a problem similar to this in 7.1.4 what our issue ended up being is the field that you are trying to pass '$*' to was formatted in the MFD as an AnV, when I changed it to an An my fex worked just fine.
WebFOCUS 7.1.4
Windows 2003
June 04, 2007, 11:45 AM
hitenThank you all for your help.
I tried what Tony and Leah suggested but this didnt work.
Made the change that JB2003 suggested and this worked, I am able to return all the records.
Thanks very much JB2003.
Also thanks to Tony and Leah.
Prod: WF 7.6.1 platform Windows, databases: msSQL2000, msSQL2005, IE6
June 04, 2007, 12:03 PM
Darin LeeQuick note to add that using '$*' won't work with a field of format A1 because the length of the value $* is too long. You would have to go with the FOC_NONE or some Dialogue Manager in that case. Second thought, NEVER use FOC_NONE with a compound WHERE. Because there is an implicit AND, there is no reason NOT to break it into several simple WHERE statements.
Regards,
Darin
In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat