unit i_SYSCJNL1;

interface

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

type
   _SYSCJNL1 = 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 getIZONENOs(tmpSessionName, tmpDatabaseName: String):TQuery;overload;
      function getIZONENOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;overload;
      function getIZONENO(tmpSessionName, tmpDatabaseName, Cond:String):TField;overload;
      function getIZONENOvalue(tmpSessionName, tmpDatabaseName, Cond:String):String;overload;
      function setIZONENOvalue(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_SYSCJNL1: _SYSCJNL1;

implementation

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

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

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

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

function _SYSCJNL1.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 ',['SYSCJNL1']);

      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 _SYSCJNL1.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(',['SYSCJNL1']);

      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 _SYSCJNL1.Delete(tmpSessionName, tmpDatabaseName, Cond:String):Boolean;
begin
   Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Delete from %s where %s',['SYSCJNL1', Cond]));
end;

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


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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setITRXCODEvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ITRXCODE = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setITRXSQNOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ITRXSQNO = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setITELLNOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ITELLNO = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

function _SYSCJNL1.getIZONENOs(tmpSessionName, tmpDatabaseName: String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select IZONENO from %s',['SYSCJNL1']));
end;

function _SYSCJNL1.getIZONENOs(tmpSessionName, tmpDatabaseName, Cond:String):TQuery;
begin
  Result := openSQL(tmpSessionName, tmpDatabaseName, Format('Select IZONENO from %s where %s',['SYSCJNL1', Cond]));
end;

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

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

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

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

function _SYSCJNL1.setIZONENOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set IZONENO = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setIBRCHNOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set IBRCHNO = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setISTATUSvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ISTATUS = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setIRANKvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set IRANK = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setISYSDATEvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set ISYSDATE = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setOOVERvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OOVER = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setOSTATvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OSTAT = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setOTRXSQNOvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OTRXSQNO = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setOLIBIDvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OLIBID = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setOTGWIDvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OTGWID = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setOSYSDATEvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OSYSDATE = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;

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

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

function _SYSCJNL1.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 _SYSCJNL1.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 _SYSCJNL1.setOTRXHEADvalue(tmpSessionName, tmpDatabaseName: String; Value:String; Cond:String):Boolean;
begin
  Result := execSQL(tmpSessionName, tmpDatabaseName, Format('Update %s set OTRXHEAD = %s where %s',
                           ['SYSCJNL1', Value, Cond])
                   );
end;
end.
