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 prjOracle_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,
     otdOracle.OtdOracleOTD otdOracle_1, com.stc.connector.appconn.file.FileApplication
     FileClient_1 ) throws Throwable
        {
            FileClient_1.setText( "Deleting record............" );
            FileClient_1.write();
            otdOracle_1.getDb_employee().delete( input.getText() );
            FileClient_1.setText( "Delete Done." );
            FileClient_1.write();
        }
    }