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.
Hi All, I have a DB table column. I want to fetch only distinct values of that column in stack and then populate a combox with those values. e.g, In CAR, We have COUNTRY column which has multiple instances of same values. I want to fetch only distinct values ENGLAND,JAPAN,ITALY and W GERMANY in a stack and then associate it with ComboBox so that in dropdown, only these values appears once. How can we achieve this? Please Suggest.
Thanks in advance.This message has been edited. Last edited by: Kerry,
Posts: 281 | Location: India | Registered: April 21, 2007
The easiest approach is to EXEC a focexec to retrieve the values using a BY fld. It would generally be a rule of thumb that list boxes and combo boxes are populated like this.
Trying to do this based on the values in a stack is doable but much more complex.
For example, to get a unique list of midinitial from an EMPDATA stack called empStack into initStack Mid:
case popStack
Declare (i/i4;j/i4;);
j=2;
stack sort empStack by midinitial;
repeat empStack.foccount i = 1;
if i eq 1 begin
initStack(i).Mid = empStack(i).midinitial;
goto endrepeat;
endbegin
if empStack(i).midinitial eq empStack(i-1).midinitial goto endrepeat;
initStack(j).Mid = empStack(i).midinitial;
j=j+1;
endrepeat i=i+1;
EndCase
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
This is basic Maintain code covered on the training courses. It is essential that you take these courses.
To call a focexec:
MAINTAIN
$$Declarations
Case Top
$$ Create a stack field to take the focexec output.
empStack.DEPARTMENT/a10;
$$ Call the focexec, simple approach
exec getDepartment into empStack;
Winform Show Form1;
EndCase
END
and the focexec getDepartment:
TABLE FILE EMPLOYEE
BY DEPARTMENT
ON TABLE PCHOLD
END
Ensure that you have a stack field with field name and format matching the output of the focexec.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007