I need to update a table for each occurance of the ID, but my code is just updating the first instance. Can someone suggest the best way to do a match loop to keep updating records that match the particular ID.
TABLE FILE RAS-OBO_HDR_TBL
PRINT
MU_CODE
VX_NO
NA_PROFORMA_ID
NA_DATE_SENT
COMPUTE NA_DATE_PRINTED/HYYMDS = HGETC(10, 'HYYMDS');
COMPUTE NA_OUT_VAL/I1 = 1;
NA_PRINTER
-*BY VX_NO NOPRINT
WHERE NA_OUT_VAL EQ 1 ;
ON TABLE HOLD AS U1
END
-RUN
MODIFY FILE RAS-NA_PROFORMA_PRINT_TRIGGER_TBL
FIXFORM FROM U1
MATCH NA_PROFORMA_ID
ON MATCH UPDATE NA_DATE_PRINTED NA_OUT_VAL
DATA ON U1
END
-RUN
-EXIT
This message has been edited. Last edited by: Donald,
TABLE FILE EMPDATA
PRINT
PIN
COMPUTE SALARY1/D12.2M = SALARY + 1.01; AS 'SALARY'
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS H001 FORMAT ALPHA
END
-RUN
MODIFY FILE EMPDATA
FIXFORM FROM H001
MATCH PIN
-*ON MATCH ACTIVATE SALARY
ON MATCH UPDATE SALARY
ON NOMATCH TYPE "NOT FOUND"
DATA ON H001
END
-RUN
TABLE FILE EMPDATA
PRINT PIN SALARY
END
Are the values for column NA_PROFORMA_ID unique in table RAS-NA_PROFORMA_PRINT_TRIGGER_TBL?
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
December 14, 2010, 04:30 PM
Donald
quote:
the values for column NA_PROFORMA_ID
The values for column NA_PROFORMA_ID will be the same for a given group of rows that need to be updated.
Depending on the data source, you may have to reposition the pointer in the modify.
For example, if the first record to be match is the last one in the file, the pointer will be past the last record, a reposition will put the pointer back to the top.
This happens for FOCUS files.
I don't think it is an issue with RDBMS's though.
What data source is the table RAS-NA_PROFORMA_PRINT_TRIGGER_TBL ?
Can you post the master and acx if it has one ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
December 14, 2010, 04:42 PM
Francis Mariani
Unless what Waz describes solves this issue, "The values for column NA_PROFORMA_ID will be the same for a given group of rows that need to be updated" won't work, one input row will update one database row - you cannot use one input row to update many database rows (unless repositioning the pointer works).
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
December 14, 2010, 04:49 PM
Donald
In the oracle dadabase I only see the first record updated, but there are three with the same proforma_ID
Here is the code that I am trying to use, but it is still just updating one record.
MODIFY FILE RAS-NA_PROFORMA_PRINT_TRIGGER_TBL
FIXFORM FROM U1
MATCH NA_PROFORMA_ID
ON MATCH UPDATE NA_DATE_PRINTED NA_OUT_VAL
ON MATCH GOTO NEXTVX
ON NOMATCH GOTO TOP
CASE NEXTVX
NEXT NA_PROFORMA_ID
ON NEXT UPDATE NA_DATE_PRINTED NA_OUT_VAL
ON NEXT GOTO NEXTVX
ON NONEXT GOTO ENDCASE
ENDCASE
DATA ON U1
END
-RUN
-EXIT