Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using Modify - how do I update a field in a focus database from a multi-vaule amper v

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using Modify - how do I update a field in a focus database from a multi-vaule amper v
 Login/Join
 
Gold member
posted
I have an html form that has a multiple value listbox. I want to take the values that are past from the listbox amper variable and include the vaules in a focus database.
I am using the following fields from the Emplyee Table:
EMP_ID
FIRST_NAME
LAST_NAME
SKILL_DESC...when I match on emp_id update first & last name then next segment match on skill_desc (there maybe upto 14 skills. How can I accomplish this since it pass the values from the listbox with 'OR' between each value.
Thanks for your help.


8.0.9, Windows
excel / pdf
 
Posts: 89 | Registered: October 21, 2010Report This Post
Expert
posted Hide Post
I think there are two ways to do this.

1. Break the multi values into records, and then update each one, at the DM level.

2. In the MODIFY create a loop that breaks up the multi values and updates each one.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Thanks Waz
I'll try it tomorrow


8.0.9, Windows
excel / pdf
 
Posts: 89 | Registered: October 21, 2010Report This Post
Gold member
posted Hide Post
Waz
do you have any DM example you can send?
I was able to etake this string :
'Value1' OR 'Value2' OR 'Value3' OR 'Value4' OR 'Value
and change it to:
'Value1','Value2','Value3','Value4','Value5'
no really sure what's the next best approach on how to connect these 5 records to one user name and then hold in a file and execute my modify command.
Thanks


8.0.9, Windows
excel / pdf
 
Posts: 89 | Registered: October 21, 2010Report This Post
Gold member
posted Hide Post
this is what I came up with, which works fine...is there a better method or is this ok?

-DEFAULT &EMP_ID='11318'
-DEFAULT &LAST_NAME='MMCDONALD'
-DEFAULT &FIRST_NAME='MATT'
-DEFAULT &DEPARTMENT='IS'
-DEFAULT &EMAIL='MMCDONALD@MEDLINE.COM'
-DEFAULT &SKILLS1='''V001'''
-DEFAULT &MEMBERSHIPS='WEBFOCUS'
-RUN
-SET &XFMT='A' | &SKILLS1.LENGTH;
-SET &VARA=STRREP(&SKILLS1.LENGTH,&SKILLS1.QUOTEDSTRING,&SKILLS1.LENGTH,''' OR ''',4,' OR ',&SKILLS1.LENGTH,'&XFMT');
-SET &VARRLEN = ARGLEN(&VARA.LENGTH,&VARA,'I5');
-SET &VARALEN = &VARRLEN - 2;
-SET &VARALEN1 = &VARRLEN - 1;
-SET &VARAFMT = 'A' || &VARALEN.EVAL;
-SET &VARB=SUBSTR(&VARA.LENGTH,&VARA,2,&VARALEN1,&VARALEN,'&VARAFMT');
-SET &VARC=STRREP(&VARB.LENGTH,&VARB.QUOTEDSTRING,2,'''',4,'''''',&VARB.LENGTH,'&XFMT');
-SET &ZXSDOC='''' || STRREP(&VARC.LENGTH,&VARC.QUOTEDSTRING,4,' OR ',5,''',''',&VARC.LENGTH,'&XFMT') || '''';
-SET &XDOC1=EDIT(&ZXSDOC,'$$$$$9999');
-SET &XDOC2=EDIT(&ZXSDOC,'$$$$$$$$$$$$9999');
-SET &XDOC3=EDIT(&ZXSDOC,'$$$$$$$$$$$$$$$$$$$9999');
-SET &XDOC4=EDIT(&ZXSDOC,'$$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|| &XDOC3 || '''' | ','
- | '''' || &XDOC4 || '''' | ','
- | '''' || &XDOC5 || '''' | ','
- | '''' || &XDOC6 || '''' | ','
- | '''' || &XDOC7 || '''' | ','
- | '''' || &XDOC8 || '''' | ','
- | '''' || &XDOC9 || '''' | ','
- | '''' || &XDOC10 || '''' | ','
- | '''' || &XDOC11 || '''' | ','
- | '''' || &XDOC12 || '''' | ','
- | '''' || &XDOC13 || '''' | ','
- | '''' || &XDOC14 || ''''
- | ');' ;
-RUN
SET ASNAMES=ON
TABLE FILE MENTORSKILLS
SUM SKILLS1 NOPRINT
BY MENTYPE
BY SKILLS1
BY SKILL_DESC1
WHERE MENTYPE EQ 'MENTOR';
WHERE SKILLS1 IN &SKILLCODE
ON TABLE HOLD AS 'HOLDSKILLS'
END
-RUN
DEFINE FILE MEDLINEMENTOR
XMENTYPE/A10='MENTOR';
XEMP_ID/A9='&EMP_ID';
XFIRST_NAME/A15='&FIRST_NAME';
XLAST_NAME/A15='&LAST_NAME';
XDEPARTMENT/A10='&DEPARTMENT';
XEMAIL/A60='&EMAIL';
XMEMBERSHIPS/A40='&MEMBERSHIPS';
END
TABLE FILE MEDLINEMENTOR
SUM MENTYPE NOPRINT
XLAST_NAME AS 'LAST_NAME'
XFIRST_NAME AS 'FIRST_NAME'
XDEPARTMENT AS 'DEPARTMENT'
XEMAIL AS 'EMAIL'
XMEMBERSHIPS AS 'MEMBERSHIPS'
BY XMENTYPE AS 'MENTYPE'
BY XEMP_ID AS 'EMP_ID'
IF RECORDLIMIT EQ 1;
WHERE MENTYPE EQ 'MENTOR';
ON TABLE HOLD AS 'HOLDMENTOR'
END
-RUN
MATCH FILE HOLDSKILLS
PRINT
SKILLS1
SKILL_DESC1
BY MENTYPE
RUN
FILE HOLDMENTOR
SUM
EMP_ID
LAST_NAME
FIRST_NAME
DEPARTMENT
EMAIL
MEMBERSHIPS
BY MENTYPE
AFTER MATCH HOLD AS 'HOLDPROF' OLD-OR-NEW
END
-RUN
MODIFY FILE MEDLINEMENTOR
LOG DBMSERR MSG OFF
LOG DUPL MSG OFF
LOG INVALID MSG OFF
LOG NOMATCH MSG OFF
LOG FORMAT MSG OFF
LOG ACCEPT MSG OFF
LOG TRANS MSG OFF
FIXFORM FROM HOLDPROF
MATCH MENTYPE EMP_ID
ON NOMATCH INCLUDE
ON MATCH UPDATE LAST_NAME FIRST_NAME DEPARTMENT EMAIL
ON MATCH CONTINUE
MATCH SKILLS1
ON NOMATCH INCLUDE
ON MATCH UPDATE SKILL_DESC1
ON MATCH CONTINUE
MATCH MEMBERSHIPS
ON NOMATCH INCLUDE
ON MATCH REJECT
DATA ON HOLDPROF
END
-RUN
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE " "
-TYPE
-TYPE " Update Submitted for - Employee ID: &EMP_ID"
-RUN
-EXIT


8.0.9, Windows
excel / pdf
 
Posts: 89 | Registered: October 21, 2010Report This Post
Expert
posted Hide Post
This will split an amper variable up.

-SET &VARA   = '''Value1'' OR ''Value2'' OR ''Value3'' OR ''Value4'' OR ''Value''' ;
-SET &VART   = STRREP(&VARA.LENGTH,&VARA,4,' OR ',5,',',&VARA.LENGTH,'A&VARA.LENGTH') ;
-SET &ZXSDOC = STRIP(&VART.LENGTH,&VART,'''','A&VART.LENGTH') ;
-SET &ZXSDOC = TRUNCATE(&ZXSDOC) ;

-TYPE &ZXSDOC

-SET &TOKEN = 1 ;
-SET &TOKSTR= GETTOK(&ZXSDOC,&ZXSDOC.LENGTH,&TOKEN,',',&ZXSDOC.LENGTH,'A&ZXSDOC.LENGTH') ;
-REPEAT SPLIT_VAR WHILE &TOKSTR NE ' ' ;
-SET &TOKSTR = TRUNCATE(&TOKSTR) ;
-TYPE Token # &TOKEN = &TOKSTR

-SET &TOKEN = &TOKEN + 1 ;
-SET &TOKSTR= GETTOK(&ZXSDOC,&ZXSDOC.LENGTH,&TOKEN,',',&ZXSDOC.LENGTH,'A&ZXSDOC.LENGTH') ;

-SPLIT_VAR


But, I think you want this, assuming I got VARA correct:

-SET &VARA   = '''Value1'' OR ''Value2'' OR ''Value3'' OR ''Value4'' OR ''Value''' ;
-SET &ZXSDOC = '(' || STRREP(&VARA.LENGTH,&VARA,4,' OR ',5,',',&VARA.LENGTH,'A&VARA.LENGTH') || ')' ;
-SET &ZXSDOC = TRUNCATE(&ZXSDOC) ;

-TYPE &VARA
-TYPE &ZXSDOC


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Thanks Waz...I'll give this a try.!


8.0.9, Windows
excel / pdf
 
Posts: 89 | Registered: October 21, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using Modify - how do I update a field in a focus database from a multi-vaule amper v

Copyright © 1996-2020 Information Builders