Using Database Operations

The Delete Operation

ProcedureTo Perform a Delete Operation on a Table

  1. Execute the delete() method.


    Note –

    The content of the input.getText() file may contain null, meaning it will not have a “where” clause or it can contain a “where” clause such as empno > 50.


    In this example DELETE an employee.


    package prjDB2_JCDjcdALL;
    
    public class jcdDelete
    {
    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,
    otdDB2.OtdDB2OTD otdDB2_1, com.stc.connector.appconn.file.FileApplication 
    FileClient_1 )
            throws Throwable
        {
            FileClient_1.setText( "Deleting record............" );
            FileClient_1.write();
            otdDB2_1.getDb_employee().delete( input.getText() );
            FileClient_1.setText( "Delete Done." );
            FileClient_1.write();
        }
    }