unit i_SYSCJNL2;

interface

uses
   DB, DBTables, Sysutils, { Variants, } i_ebss;

type
   _SYSCJNL2 = class(_ebss)
   public
      function getAllRows(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getAllRows(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;

      function getSomeColumns(tmpSessionName, tmpDatabaseName, ColumnNames:String):TQuery;overload;
      function getSomeColumns(tmpSessionName, tmpDatabaseName, ColumnNames, Cond:String):TQuery;overload;
      function setSomeColumns(tmpSessionName, tmpDatabaseName: String;FieldNames, Values: Variant) :Boolean;

      function Insert(tmpSessionName, tmpDatabaseName:String;Values: Variant):Boolean;
      function Delete(tmpSessionName, tmpDatabaseName, Cond:String):Boolean;
      function Empty(tmpSessionName, tmpDatabaseName: String):Boolean;

      function getITRXCODEs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getITRXCODEs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getITRXCODE(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getITRXCODEvalue(tmpSessionName, tmpDatabaseName, Cond:String):Real;overload;
      function setITRXCODEvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getITRXSQNOs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getITRXSQNOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getITRXSQNO(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getITRXSQNOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setITRXSQNOvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getITELLNOs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getITELLNOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getITELLNO(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getITELLNOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setITELLNOvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getIBRCHNOs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getIBRCHNOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getIBRCHNO(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getIBRCHNOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setIBRCHNOvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getISTATUSs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getISTATUSs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getISTATUS(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getISTATUSvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setISTATUSvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getIRANKs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getIRANKs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getIRANK(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getIRANKvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setIRANKvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getISYSDATEs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getISYSDATEs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getISYSDATE(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getISYSDATEvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setISYSDATEvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getOOVERs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getOOVERs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getOOVER(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getOOVERvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setOOVERvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getOSTATs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getOSTATs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getOSTAT(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getOSTATvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setOSTATvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getOTRXSQNOs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getOTRXSQNOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getOTRXSQNO(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getOTRXSQNOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setOTRXSQNOvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getOLIBIDs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getOLIBIDs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getOLIBID(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getOLIBIDvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setOLIBIDvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getOTGWIDs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getOTGWIDs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getOTGWID(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getOTGWIDvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setOTGWIDvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getOSYSDATEs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getOSYSDATEs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getOSYSDATE(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getOSYSDATEvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setOSYSDATEvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;

      function getOTRXHEADs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getOTRXHEADs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getOTRXHEAD(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getOTRXHEADvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setOTRXHEADvalue(tmpSessionName, tmpDatabaseName:String; Value:String; Cond:String):Boolean;
   end;

var
   admin_SYSCJNL2: _SYSCJNL2;

implementation

function _SYSCJNL2.getAllRows(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
   Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select * from %s', ['SYSCJNL2']));
end;

function _SYSCJNL2.getAllRows(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
   Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select * from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getSomeColumns(tmpSessionName, tmpDatabaseName, ColumnNames:String):TQuery;
begin
   Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select %s from %s',[ColumnNames, 'SYSCJNL2']));
end;

function _SYSCJNL2.getSomeColumns(tmpSessionName, tmpDatabaseName, ColumnNames, Cond:String):TQuery;
begin
   Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select %s from %s where %s',[ColumnNames, 'SYSCJNL2', Cond]));
end;

function _SYSCJNL2.setSomeColumns(tmpSessionName, tmpDatabaseName: String;FieldNames, Values: Variant) :Boolean;
var
   i,n: Integer;
   NamesCount, ValuesCount:Integer;
   tmpSQL: String;
begin
   Result := False;

   NamesCount := VarArrayHighBound(FieldNames, 1);
   ValuesCount := VarArrayHighBound(Values, 1);

   If NamesCount = ValuesCount then
   begin
      n := NamesCount;

      tmpSQL := Format('Update %s set ',['SYSCJNL2']);

      For i:= 0 to n do
      begin
         tmpSQL := tmpSQL + Format('%s = %s',[FieldNames[i], Values[i]]);
         If i < n then
         begin
            tmpSQL := tmpSQL +', ';
         end;
      end;
      Result := execSQL(tmpSessionName, tmpDatabaseName, tmpSQL);
   end;
end;

function _SYSCJNL2.Insert(tmpSessionName, tmpDatabaseName: String;Values: Variant):Boolean;
var
   i,n: Integer;
   ValueCount: Integer;
   tmpSQL: String;
begin
   Result := False;

   ValueCount := VarArrayHighBound(Values, 1);

   If ValueCount > 0 then
   begin
      n := ValueCount;

      tmpSQL := Format('Insert into %s values(',['SYSCJNL2']);

      For i:= 0 to n do
      begin
         tmpSQL := tmpSQL + Format('%s',[Values[i]]);
         If i < n then
         begin
            tmpSQL := tmpSQL +', ';
         end;
      end;
      tmpSQL := tmpSQL + ')';

      Result := execSQL(tmpSessionName, tmpDatabaseName, tmpSQL);
   end;
end;

function _SYSCJNL2.Delete(tmpSessionName, tmpDatabaseName, Cond:String):Boolean;
begin
   Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Delete from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.Empty(tmpSessionName, tmpDatabaseName: String):Boolean;
begin
   Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Delete from %s',['SYSCJNL2']));
end;


function _SYSCJNL2.getITRXCODEs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ITRXCODE from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getITRXCODEs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ITRXCODE from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getITRXCODE(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getITRXCODEs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ITRXCODE');
  end;
  Query.Free;
end;

function _SYSCJNL2.getITRXCODEvalue(tmpSessionName, tmpDatabaseName, Cond:String):Real;
var
  Query: TQuery;
begin
  Result := -1;

  Query := getITRXCODEs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ITRXCODE').AsVariant;
  end;
  Query.Free;
end;

function _SYSCJNL2.setITRXCODEvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ITRXCODE = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getITRXSQNOs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ITRXSQNO from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getITRXSQNOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ITRXSQNO from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getITRXSQNO(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getITRXSQNOs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ITRXSQNO');
  end;
  Query.Free;
end;

function _SYSCJNL2.getITRXSQNOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getITRXSQNOs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ITRXSQNO').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setITRXSQNOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ITRXSQNO = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getITELLNOs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ITELLNO from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getITELLNOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ITELLNO from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getITELLNO(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getITELLNOs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ITELLNO');
  end;
  Query.Free;
end;

function _SYSCJNL2.getITELLNOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getITELLNOs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ITELLNO').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setITELLNOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ITELLNO = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getIBRCHNOs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select IBRCHNO from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getIBRCHNOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select IBRCHNO from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getIBRCHNO(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getIBRCHNOs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('IBRCHNO');
  end;
  Query.Free;
end;

function _SYSCJNL2.getIBRCHNOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getIBRCHNOs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('IBRCHNO').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setIBRCHNOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set IBRCHNO = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getISTATUSs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ISTATUS from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getISTATUSs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ISTATUS from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getISTATUS(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getISTATUSs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ISTATUS');
  end;
  Query.Free;
end;

function _SYSCJNL2.getISTATUSvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getISTATUSs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ISTATUS').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setISTATUSvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ISTATUS = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getIRANKs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select IRANK from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getIRANKs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select IRANK from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getIRANK(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getIRANKs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('IRANK');
  end;
  Query.Free;
end;

function _SYSCJNL2.getIRANKvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getIRANKs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('IRANK').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setIRANKvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set IRANK = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getISYSDATEs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ISYSDATE from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getISYSDATEs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select ISYSDATE from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getISYSDATE(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getISYSDATEs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ISYSDATE');
  end;
  Query.Free;
end;

function _SYSCJNL2.getISYSDATEvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getISYSDATEs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('ISYSDATE').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setISYSDATEvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ISYSDATE = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getOOVERs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OOVER from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getOOVERs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OOVER from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getOOVER(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getOOVERs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OOVER');
  end;
  Query.Free;
end;

function _SYSCJNL2.getOOVERvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getOOVERs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OOVER').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setOOVERvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OOVER = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getOSTATs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OSTAT from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getOSTATs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OSTAT from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getOSTAT(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getOSTATs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OSTAT');
  end;
  Query.Free;
end;

function _SYSCJNL2.getOSTATvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getOSTATs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OSTAT').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setOSTATvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OSTAT = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getOTRXSQNOs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OTRXSQNO from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getOTRXSQNOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OTRXSQNO from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getOTRXSQNO(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getOTRXSQNOs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OTRXSQNO');
  end;
  Query.Free;
end;

function _SYSCJNL2.getOTRXSQNOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getOTRXSQNOs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OTRXSQNO').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setOTRXSQNOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OTRXSQNO = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getOLIBIDs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OLIBID from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getOLIBIDs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OLIBID from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getOLIBID(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getOLIBIDs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OLIBID');
  end;
  Query.Free;
end;

function _SYSCJNL2.getOLIBIDvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getOLIBIDs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OLIBID').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setOLIBIDvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OLIBID = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getOTGWIDs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OTGWID from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getOTGWIDs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OTGWID from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getOTGWID(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getOTGWIDs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OTGWID');
  end;
  Query.Free;
end;

function _SYSCJNL2.getOTGWIDvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getOTGWIDs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OTGWID').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setOTGWIDvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OTGWID = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getOSYSDATEs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OSYSDATE from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getOSYSDATEs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OSYSDATE from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getOSYSDATE(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getOSYSDATEs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OSYSDATE');
  end;
  Query.Free;
end;

function _SYSCJNL2.getOSYSDATEvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getOSYSDATEs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OSYSDATE').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setOSYSDATEvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OSYSDATE = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;

function _SYSCJNL2.getOTRXHEADs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OTRXHEAD from %s',['SYSCJNL2']));
end;

function _SYSCJNL2.getOTRXHEADs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select OTRXHEAD from %s where %s',['SYSCJNL2', Cond]));
end;

function _SYSCJNL2.getOTRXHEAD(tmpSessionName, tmpDatabaseName, Cond:String):TField;
var
  Query: TQuery;
begin
  Result := nil;

  Query := getOTRXHEADs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OTRXHEAD');
  end;
  Query.Free;
end;

function _SYSCJNL2.getOTRXHEADvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;
var
  Query: TQuery;
begin
  Result := 'null';

  Query := getOTRXHEADs(tmpSessionName, tmpDatabaseName, Cond);
  If Not Query.IsEmpty then
  begin
    Result := Query.FieldByName('OTRXHEAD').AsString;
  end;
  Query.Free;
end;

function _SYSCJNL2.setOTRXHEADvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OTRXHEAD = %s where %s',
                           ['SYSCJNL2', Value, Cond])
                   );
end;
end.
