Focal Point
Updating a focus table

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6617064806

August 16, 2011, 04:13 PM
Poryes
Updating a focus table
Hi,
while I was updating focus table I'm getting the below error.

(FOC480) A KEY FIELD CANNOT BE UPDATED USING MODIFY:

Below is code.
CRTFORM LINE 1
" STATE . . . . :
MATCH ST
ON NOMATCH TYPE
"STATE ON NOMATCH REJECT
ON NOMATCH GOTO OPTION2
ON MATCH CRTFORM LINE 13

" THE VALUES ON TABLE FOR THE SELECTED STATE:" TCODE . . . . . . :"
" TTYPE . . . . . . :"
" TUTH . . . . . . . .:"
" "
ON MATCH TYPE
" RECORD UPDATED "
ON MATCH UPDATE CODE TYPE TUTH
ON MATCH GOTO OPTION2
*
ENDCASE
DATA
END

Any help would be highly appreciated.


WebFOCUS 7.6.13

Mainframe
all output (Report in mainframe)
August 16, 2011, 04:36 PM
Dan Satchell
As the message states, key fields cannot be changed via UPDATE. There are alternatives. If you are performing changes to single records, you can DELETE the old record and then INCLUDE a new record with the new key value. If you are performing changes to many records, it may be easier to make the changes to the records as you dump them out to a HOLD file, then re-create the table, and finally reload the data from the HOLD file.


WebFOCUS 7.7.05
August 16, 2011, 05:17 PM
Poryes
Yes Dan,

It's for a single record. Any sample code to accomplish. Please let me know.

This message has been edited. Last edited by: Poryes,


WebFOCUS 7.6.13

Mainframe
all output (Report in mainframe)