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.
We are developing a report to allow the users to enter and update new data to the Sql Server database. We need to update 12 months of data for multiple parts by customer for e.g. :-
Customer 1 -- Update Button (to update all parts information for Customer 1)
Part 1 12 10 13 14 15 10 5 10 20 30 0 10
Part 2 5 10 20 20 10 0 10 100 50 20 10 40
Part 3 15 80 100 30 10 0 60 30 70 30 90 10
Customer 2 -- Update Button (to update all parts information for Customer 2)
Part 1 102 100 113 140 150 10 5 10 20 30 0 10
Part 2 50 110 210 250 100 0 10 100 50 20 10 40
The approach we are trying to use is to read all the data using javascript and save it to a text file and then read from the text file to update to the database.
As an alternative the following is a replacement for the old FOCUS AUTOMOD facility for use on single segment tables (FOCUS or SQL) allowing insert, update and delete.
Still needs a little bit of work for some formats but generally works fine.
-DEFAULTS &ENTRYPOINT='START'
-DEFAULTS &FOCDB='GGORDER'
SET MSG=ON
SET EMPTYREPORT=ON
-GOTO &ENTRYPOINT
-START
-HTMLFORM BEGIN
<HTML>
<FORM name="DB" method="post" action="/ibi_apps/WFServlet">
<INPUT type="hidden" name="IBIF_ex" value="automod">
<INPUT type="hidden" name="ENTRYPOINT" value="GETKEY">
<a>Enter the name of the table you wish to use</a><BR>
<INPUT TYPE="TEXT" NAME="FOCDB" VALUE=" ">
<INPUT TYPE="SUBMIT" NAME="Select" VALUE="Select">
</FORM>
</HTML>
-HTMLFORM END
-EXIT
-GETKEY
CHECK FILE &FOCDB HOLD
-RUN
TABLE FILE HOLD
"Please enter the key for the record you want"
PRINT FIELDNAME AS ''
COMPUTE KEYFLD/A200=
'<INPUT TYPE="TEXT" SIZE="55" NAME=ROWID MAXLENGTH="256" VALUE=" ">'; AS ''
WHERE FLDNO EQ 1
ON TABLE SET PAGE NOLEAD
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS ROWSEL FORMAT HTMTABLE
END
-RUN
-HTMLFORM BEGIN
<HTML>
<FORM name="DB" method="post" action="/ibi_apps/WFServlet">
<INPUT type="hidden" name="IBIF_ex" value="automod">
<INPUT type="hidden" name="ENTRYPOINT" value="GETROW">
<INPUT TYPE="HIDDEN" NAME="FOCDB" VALUE="!IBI.AMP.FOCDB;">
!IBI.FIL.ROWSEL;
<INPUT TYPE="SUBMIT" NAME="Select" VALUE="Select">
</FORM>
</HTML>
-HTMLFORM END
-EXIT
-GETROW
CHECK FILE &FOCDB HOLD
-RUN
TABLE FILE HOLD
SUM COMPUTE COLNO/I5= MAX.FLDNO -1;
PRINT
FIELDNAME FORMAT EXLEN
BY FLDNO NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS ALLCOLS FORMAT ALPHA
END
-RUN
-SET &NOCOLS=&LINES;
-SET &CNTR=0;
-REPEAT COLVAR &NOCOLS TIMES
-SET &CNTR=&CNTR +1;
-READ ALLCOLS &COLS.A5. &FLD&CNTR.EVAL.A66. &FMT&CNTR.EVAL.A8. &FLDLEN&CNTR.EVAL.A4.
-COLVAR
-*
TABLE FILE &FOCDB
PRINT *
IF &FLD1.EVAL EQ &ROWID
WHERE RECORDLIMIT EQ 1
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS ROW FORMAT ALPHA
END
-RUN
-SET &ROWLINES = &LINES;
-SET &ALLCOLS= &COLS + 1;
-IF &ROWLINES GT 0 GOTO HAVEROW;
DEFINE FILE &FOCDB
DUMMY/A1=' ';
INSERT/A200= '<INPUT TYPE="SUBMIT" NAME="INSERT" VALUE="INSERT">';
CANCEL/A200= '<INPUT TYPE="BUTTON" NAME="Cancel" VALUE="Cancel" onClick="javascript:history.back();">';
END
TABLE FILE &FOCDB
PRINT &FLD1.EVAL NOPRINT
-SET &FLDLEN=&FLDLEN1.EVAL * 1.5;
COMPUTE KEYFLD/A500='<INPUT TYPE="TEXT" SIZE="&FLDLEN.EVAL" NAME="FLD1" VALUE="&ROWID"> (&FMT1.EVAL)';
AS '&FLD1.EVAL' OVER
-SET &CNTR=2;
-REPEAT ENDREPEAT1 &COLS TIMES
-SET &FLDLEN=&FLDLEN&CNTR.EVAL * 1.5;
COMPUTE KEYFLD/A500='<INPUT TYPE="TEXT" SIZE="&FLDLEN.EVAL" NAME="FLD&CNTR.EVAL" VALUE=" "> (&FMT&CNTR.EVAL)';
AS '&FLD&CNTR.EVAL' OVER
-SET &CNTR=&CNTR+1;
-ENDREPEAT1
DUMMY AS ''
ON TABLE SUBFOOT
"<INSERT <CANCEL "
WHERE RECORDLIMIT EQ 1
ON TABLE SET PAGE NOLEAD
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS INSERT FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<HTML>
<HEAD>
</HEAD>
<FORM name="automod" method="post" action="/ibi_apps/WFServlet">
<INPUT type="hidden" name="IBIF_ex" value="automod">
<INPUT type="hidden" name="ENTRYPOINT" value="INSERT">
<INPUT type="hidden" name="FOCDB" value="!IBI.AMP.FOCDB;">
<INPUT type="hidden" name="ALLCOLS" value="!IBI.AMP.ALLCOLS;">
!IBI.FIL.INSERT;
</FORM>
</HTML>
-HTMLFORM END
-EXIT
-HAVEROW
DEFINE FILE ROW
DUMMY/A1=' ';
UPDATE/A200= '<INPUT TYPE="SUBMIT" NAME="Update" VALUE="Update" onClick="return updateRow();">';
DELETE/A200= '<INPUT TYPE="BUTTON" NAME="Delete" VALUE="Delete" onClick="return deleteRow();">';
CANCEL/A200= '<INPUT TYPE="BUTTON" NAME="Cancel" VALUE="Cancel" onClick="javascript:history.back();">';
END
TABLE FILE ROW
PRINT
-SET &FLD1a= IF EDIT(&FMT1,'9') EQ 'A' THEN &FLD1.EVAL ELSE 'EDIT(&FLD1.EVAL)';
COMPUTE KEYFIELD/A500 = IF &ROWLINES EQ 0 THEN
'<INPUT TYPE="TEXT" NAME="FLD1" SIZE="&FLDLEN1.EVAL" VALUE="&FLD1a.EVAL"> (&FMT1.EVAL)' ELSE
&FLD1a.EVAL; AS '&FLD1.EVAL'
COMPUTE ROWKEY/A500 = '<INPUT TYPE="HIDDEN" NAME="ROWKEY" SIZE="&FLDLEN1.EVAL" VALUE="' || &FLD1a.EVAL || '">' ; AS ''
OVER
-SET &CNTR=2;
-REPEAT ENDREPEAT1 &COLS TIMES
-SET &COLTYPE=EDIT(&FMT&CNTR.EVAL,'9');
-SET &FLDLEN=&FLDLEN&CNTR.EVAL * 1.5;
-SET &DFMT=IF '&COLTYPE.EVAL' EQ 'D' THEN TRUNCATE(&FMT&CNTR.EVAL) ELSE IF '&COLTYPE.EVAL' EQ 'I' THEN 'F9' ELSE 'D12.2';
-SET &PFMT=IF '&COLTYPE.EVAL' EQ 'P' THEN TRUNCATE(&FMT&CNTR.EVAL) ELSE 'P11';
-SET &DCOL=IF '&COLTYPE.EVAL' EQ 'D' OR 'I' THEN TRUNCATE(&FLD&CNTR.EVAL) ELSE 1.1;
-SET &USECOL= IF '&COLTYPE.EVAL' EQ 'A' THEN &FLD&CNTR.EVAL ELSE
- IF '&COLTYPE.EVAL' EQ 'P' THEN 'PTOA(&DCOL.EVAL,' || '''' || '(&PFMT.EVAL)' || '''' || ',' || ''''
- || 'A15' || '''' || ')' ELSE
- IF '&COLTYPE.EVAL' EQ 'D' OR 'F' THEN 'FTOA(&DCOL.EVAL,' || '''' || '(&DFMT.EVALc)' || '''' || ','
- || '''' || 'A15' || '''' || ')' ELSE
- IF '&COLTYPE.EVAL' EQ 'I' THEN 'EDIT(&FLD&CNTR.EVAL)' ELSE
- IF TRUNCATE(&FMT&CNTR.EVAL) EQ 'DMY' OR 'MDY' OR 'YMD' OR 'DMYY' OR 'MDYY' OR 'YYMD' THEN
- 'CHGDAT(' || '''' || 'YMD' || '''' ||',' || '''' || '&FMT&CNTR.EVAL' || '''' || ',TEMP_DATE,'
- || '''' || 'A17' || '''' || ')' ELSE
- ' ';
-SET &TEMPDATE=IF TRUNCATE(&FMT&CNTR.EVAL) EQ 'DMY' OR 'MDY' OR 'YMD' OR 'DMYY' OR 'MDYY' OR 'YYMD' THEN
- 'COMPUTE TEMP_DATE/A6YMD = &FLD&CNTR.EVAL; NOPRINT' ELSE ' ';
-*
-* date formats needed
-*
&TEMPDATE.EVAL
COMPUTE COLVAL&CNTR.EVAL/A256= LJUST(&FLDLEN, &USECOL.EVAL , 'A&FLDLEN'); NOPRINT
COMPUTE KEYFLD/A500='<INPUT TYPE="TEXT" SIZE="&FLDLEN.EVAL" NAME="FLD&CNTR.EVAL" VALUE="'|| COLVAL&CNTR.EVAL
||'"> (&FMT&CNTR.EVAL)'; AS '&FLD&CNTR.EVAL' OVER
-SET &CNTR=&CNTR+1;
-ENDREPEAT1
DUMMY AS ''
ON TABLE SUBFOOT
"<UPDATE <DELETE <CANCEL "
ON TABLE SET PAGE NOLEAD
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS UPDATE FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF,$
ENDSTYLE
END
-RUN
-UPDATEROW
-HTMLFORM BEGIN
<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
function deleteRow()
{
var x=window.confirm("are you sure that you wish to delete this row");
if (x)
{
window.document.automod.ENTRYPOINT.value="DELETE";
window.document.automod.submit();
}
else
{
return false;
}
}
</SCRIPT>
<SCRIPT TYPE="text/javascript">
function updateRow()
{
var x=window.confirm("are you sure that you wish to update this row");
if (x)
{
window.document.automod.ENTRYPOINT.value="UPDATE";
window.document.automod.submit();
}
else
{
return false;
}
}
</SCRIPT>
</HEAD>
<FORM name="automod" method="post" action="/ibi_apps/WFServlet">
<INPUT type="hidden" name="IBIF_ex" value="automod">
<INPUT type="hidden" name="ENTRYPOINT" value="START">
<INPUT type="hidden" name="FOCDB" value="!IBI.AMP.FOCDB;">
<INPUT type="hidden" name="COLS" value="!IBI.AMP.COLS;">
!IBI.FIL.UPDATE;
</FORM>
</HTML>
-HTMLFORM END
-EXIT
-DELETE
MODIFY FILE &FOCDB
FREEFORM
MATCH * KEYS
ON MATCH DELETE
ON NOMATCH REJECT
DATA
&ROWKEY.EVAL,$
END
-RUN
-HTMLFORM BEGIN
<HTML>
<FORM name="delete" method="post" action="/ibi_apps/WFServlet">
<INPUT type="hidden" name="IBIF_ex" value="automod">
<INPUT type="hidden" name="FOCDB" value="!IBI.AMP.FOCDB;">
<INPUT type="hidden" name="ENTRYPOINT" value="GETKEY">
<a>Row Deleted</a>
<INPUT TYPE="SUBMIT" NAME="Continue" VALUE="Continue">
</FORM>
</HTML>
-HTMLFORM END
-EXIT
-INSERT
-SET &CNTR=1;
-SET &DSTRING= '~';
-REPEAT ENDDATAI &ALLCOLS TIMES
-SET &DSTRING ='&DSTRING.EVAL' || '&FLD&CNTR.EVAL,';
-SET &CNTR=&CNTR+1;
-ENDDATAI
-SET &DSL=&DSTRING.LENGTH -1;
-SET &DATASTRING =STRIP(&DSTRING.LENGTH, '&DSTRING.EVAL', '~', 'A&DSL.EVAL');
-*
MODIFY FILE &FOCDB
FREEFORM
MATCH * KEYS
ON MATCH REJECT
ON NOMATCH INCLUDE
DATA
&DATASTRING.EVAL$
END
-RUN
-SET &MSG=IF &ACCEPTS NE 1 THEN 'Transaction rejected, Please check your data' ELSE 'Row Inserted';
-SET &BACK=IF &ACCEPTS NE 1 THEN '<INPUT TYPE="BUTTON" NAME="Back" VALUE="Back" onClick="javascript:history.back();">'
- ELSE ' ';
-HTMLFORM BEGIN
<HTML>
<FORM name="delete" method="post" action="/ibi_apps/WFServlet">
<INPUT type="hidden" name="IBIF_ex" value="automod">
<INPUT type="hidden" name="FOCDB" value="!IBI.AMP.FOCDB;">
<INPUT type="hidden" name="ENTRYPOINT" value="GETKEY">
<a>!IBI.AMP.MSG;</a>
<INPUT TYPE="SUBMIT" NAME="Continue" VALUE="Continue">
!IBI.AMP.BACK;
</FORM>
</HTML>
-HTMLFORM END
-EXIT
-UPDATE
-SET &CNTR=2;
-SET &DSTRING= '&ROWKEY.EVAL,';
-REPEAT ENDDATAI &COLS TIMES
-SET &DSTRING ='&DSTRING.EVAL' || '&FLD&CNTR.EVAL,';
-SET &CNTR=&CNTR+1;
-ENDDATAI
-SET &DSL=&DSTRING.LENGTH -1;
-SET &DATASTRING =STRIP(&DSTRING.LENGTH, '&DSTRING.EVAL', '~', 'A&DSL.EVAL');
-*
MODIFY FILE &FOCDB
FREEFORM
MATCH * KEYS
ON MATCH UPDATE *
ON NOMATCH REJECT
DATA
&DATASTRING.EVAL,$
END
-RUN
-SET &MSG=IF &ACCEPTS NE 1 THEN 'Transaction rejected, Please check your data' ELSE 'Row Updated';
-SET &BACK=IF &ACCEPTS NE 1 THEN '<INPUT TYPE="BUTTON" NAME="Back" VALUE="Back" onClick="javascript:history.back();">'
- ELSE ' ';
-HTMLFORM BEGIN
<HTML>
<FORM name="delete" method="post" action="/ibi_apps/WFServlet">
<INPUT type="hidden" name="IBIF_ex" value="automod">
<INPUT type="hidden" name="FOCDB" value="!IBI.AMP.FOCDB;">
<INPUT type="hidden" name="ENTRYPOINT" value="GETKEY">
<a>!IBI.AMP.MSG;</a>
<INPUT TYPE="SUBMIT" NAME="Continue" VALUE="Continue">
!IBI.AMP.BACK;
</FORM>
</HTML>
-HTMLFORM END
-EXIT