Using Database Operations

The Update Operation

ProcedureTo perform an update operation on a table:

  1. Execute the update() method.

  2. Using a while loop together with next(), move to the row that you want to update.

  3. Assign updating value(s) to the fields of the table OTD

  4. Update the row by calling updateRow().


    package prjVSAM_JCDjcdALL;
    
    public class jcdUpdate
    {
    
        public com.stc.codegen.logger.Logger logger;
    
        public com.stc.codegen.alerter.Alerter alerter;
    
        public com.stc.codegen.util.CollaborationContext collabContext;
    
        public com.stc.codegen.util.TypeConverter typeConverter;
    
        public void receive( com.stc.connector.appconn.file.FileTextMessage
    input, otdVSAM.OtdVSAMOTD otdVSAM_1, dtd.otdOutputDTD_1935483687.
    Emp otdOutputDTD_Emp_1, com.stc.connector.appconn.file.FileApplication FileClient_1 )
            throws Throwable
        {
            FileClient_1.setText( "Update the Department .. " );
            FileClient_1.write();
            otdVSAM_1.getCICSEMP().update( input.getText() );
            while (otdVSAM_1.getCICSEMP().next()) {
                otdVSAM_1.getCICSEMP().setDEPARTMENT( "QAQAQA" );
                otdVSAM_1.getCICSEMP().updateRow();
            }
            FileClient_1.setText( "Done Update." );
            FileClient_1.write();
        }
    
    }