Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
공백 변경 숨기기
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
텍스트 스타일
모양 변경
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
second transform - edit mode, again temp=0.2; prompt "Write a function above prOpenSQL procedure, which outputs SQL conditions, when given SQL column name, date & time GUI controls as input parameters."
생성일
4년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
30 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
59 행
복사
24 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
53 행
복사
복사
복사됨
복사
복사됨
function fnGetSqlConditions(const ASqlColumnName: String;
const ADatePicker: TDatePickerFrame;
const ATimePickerFrom, ATimePickerTo: TTimePickerFrame): String;
begin
Result := '';
// filtering DATA_INS by creation date range
if (ADatePicker.DateFrom <> 0) then begin
if (not ATimePickerFrom.fnIsEmpty()) then
Result := Result + Format(' and %s >= %s', [ASqlColumnName, QuotedStr(fnDateToSqlStr(ADatePicker.DateFrom + ATimePickerFrom.Value))])
else
Result := Result + Format(' and %s >= %s', [ASqlColumnName, QuotedStr(fnDateToSqlStr(ADatePicker.DateFrom))]);
end;
if (ADatePicker.DateTo <> 0) then begin
if (not ATimePickerTo.fnIsEmpty()) then
Result := Result + Format(' and %s <= %s', [ASqlColumnName, QuotedStr(fnDateToSqlStr(ADatePicker.DateTo + ATimePickerTo.Value))])
else
Result := Result + Format(' and %s <= %s', [ASqlColumnName, QuotedStr(fnDateToSqlStr(ADatePicker.DateTo))]);
end;
end;
procedure TfmWebLogForm.prOpenSQL;
procedure TfmWebLogForm.prOpenSQL;
const
const
C_SQL = 'select hdl_d11, hdl_d02_d11, hdl_007_d11, hdl_d11_d11, event_d11, '
C_SQL = 'select hdl_d11, hdl_d02_d11, hdl_007_d11, hdl_d11_d11, event_d11, '
+ ' time_d11, '
+ ' time_d11, '
+ ' remote_ip_d11, user_d11, session_id_d11, url_d11, content_type_d11, content_d11'
+ ' remote_ip_d11, user_d11, session_id_d11, url_d11, content_type_d11, content_d11'
+ ' from tweb_srv_log_d11 d11 where'
+ ' from tweb_srv_log_d11 d11 where'
+ ' d11.hdl_d11_d11 is null';
+ ' d11.hdl_d11_d11 is null';
begin
begin
frmSQLGridFrame1.SQLText := C_SQL;
frmSQLGridFrame1.SQLText := C_SQL;
// add query filters for:
// add query filters for:
// - filtering HDL_D02
// - filtering HDL_D02
// - filtering DATA_INS by creation date range (incl time)
// - filtering DATA_INS by creation date range (incl time)
// - filtering TIME by execution date range (incl time)
// - filtering TIME by execution date range (incl time)
// immediately after that, open query
// immediately after that, open query
// use QuotedStr and fnDateToSqlStr(TDateTime) to format TDateTime parameters for the query
// use QuotedStr and fnDateToSqlStr(TDateTime) to format TDateTime parameters for the query
// if time is not empty, use property Value to extract it from time picker
// if time is not empty, use property Value to extract it from time picker
// time must be added to date before casting to string
// time must be added to date before casting to string
//filtering HDL_D02
//filtering HDL_D02
if (HdlD02 <> 0) then
if (HdlD02 <> 0) then
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and HDL_D02_D11 = %d', [HdlD02]);
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and HDL_D02_D11 = %d', [HdlD02]);
복사
복사됨
복사
복사됨
// filtering DATA_INS by creation date range
// filtering DATA_INS by creation date range
, filtering TIME by execution date range
if (dpCreated.DateFrom <> 0) then begin
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText +
fnGetSqlConditions('DATA_INS_D11', dpCreated, edtTimeCreatedFrom, edtTimeCreatedTo) + fnGetSqlConditions('TIME_D11', dpExecuted, edtTimeExecutedFrom, edtTimeExecutedTo);
if (not edtTimeCreatedFrom.fnIsEmpty()) then
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and DATA_INS_D11 >= %s', [QuotedStr(fnDateToSqlStr(dpCreated.DateFrom + edtTimeCreatedFrom.Value))])
else
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText +
Format(' and DATA_INS_D11 >= %s', [QuotedStr(fnDateToSqlStr(dpCreated.DateFrom))]);
end;
if (dpCreated.DateTo <> 0) then begin
if (not edtTimeCreatedTo.fnIsEmpty()) then
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and DATA_INS_D11 <= %s', [QuotedStr(fnDateToSqlStr(dpCreated.DateTo + edtTimeCreatedTo.Value))])
else
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and DATA_INS_D11 <= %s', [QuotedStr(fnDateToSqlStr(dpCreated.DateTo))]);
end;
// filtering TIME by execution date range
if (dpExecuted.DateFrom <> 0) then begin
if (not edtTimeExecutedFrom.fnIsEmpty()) then
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and TIME_D11 >= %s', [QuotedStr(fnDateToSqlStr(dpExecuted.DateFrom + edtTimeExecutedFrom.Value))])
else
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and TIME_D11 >= %s', [QuotedStr(fnDateToSqlStr(dpExecuted.DateFrom))]);
end;
if (dpExecuted.DateTo <> 0) then begin
if (not edtTimeExecutedTo.fnIsEmpty()) then
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and TIME_D11 <= %s', [QuotedStr(fnDateToSqlStr(dpExecuted.DateTo + edtTimeExecutedTo.Value))])
else
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and TIME_D11 <= %s', [QuotedStr(fnDateToSqlStr(dpExecuted.DateTo))]);
end;
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + ' order by DATA_INS_D11 desc';
frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + ' order by DATA_INS_D11 desc';
frmSQLGridFrame1.prOpenQuery;
frmSQLGridFrame1.prOpenQuery;
frmSQLGridFrame1.OnRowRefresh := prRowInfo;
frmSQLGridFrame1.OnRowRefresh := prRowInfo;
frmSQLGridFrame1.VisibleColumnsList.Values['DATA_INS_D11'] := 'Created';
frmSQLGridFrame1.VisibleColumnsList.Values['DATA_INS_D11'] := 'Created';
end;
end;
저장된 비교 결과
원본
파일 열기
procedure TfmWebLogForm.prOpenSQL; const C_SQL = 'select hdl_d11, hdl_d02_d11, hdl_007_d11, hdl_d11_d11, event_d11, ' + ' time_d11, ' + ' remote_ip_d11, user_d11, session_id_d11, url_d11, content_type_d11, content_d11' + ' from tweb_srv_log_d11 d11 where' + ' d11.hdl_d11_d11 is null'; begin frmSQLGridFrame1.SQLText := C_SQL; // add query filters for: // - filtering HDL_D02 // - filtering DATA_INS by creation date range (incl time) // - filtering TIME by execution date range (incl time) // immediately after that, open query // use QuotedStr and fnDateToSqlStr(TDateTime) to format TDateTime parameters for the query // if time is not empty, use property Value to extract it from time picker // time must be added to date before casting to string //filtering HDL_D02 if (HdlD02 <> 0) then frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and HDL_D02_D11 = %d', [HdlD02]); // filtering DATA_INS by creation date range if (dpCreated.DateFrom <> 0) then begin if (not edtTimeCreatedFrom.fnIsEmpty()) then frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and DATA_INS_D11 >= %s', [QuotedStr(fnDateToSqlStr(dpCreated.DateFrom + edtTimeCreatedFrom.Value))]) else frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and DATA_INS_D11 >= %s', [QuotedStr(fnDateToSqlStr(dpCreated.DateFrom))]); end; if (dpCreated.DateTo <> 0) then begin if (not edtTimeCreatedTo.fnIsEmpty()) then frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and DATA_INS_D11 <= %s', [QuotedStr(fnDateToSqlStr(dpCreated.DateTo + edtTimeCreatedTo.Value))]) else frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and DATA_INS_D11 <= %s', [QuotedStr(fnDateToSqlStr(dpCreated.DateTo))]); end; // filtering TIME by execution date range if (dpExecuted.DateFrom <> 0) then begin if (not edtTimeExecutedFrom.fnIsEmpty()) then frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and TIME_D11 >= %s', [QuotedStr(fnDateToSqlStr(dpExecuted.DateFrom + edtTimeExecutedFrom.Value))]) else frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and TIME_D11 >= %s', [QuotedStr(fnDateToSqlStr(dpExecuted.DateFrom))]); end; if (dpExecuted.DateTo <> 0) then begin if (not edtTimeExecutedTo.fnIsEmpty()) then frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and TIME_D11 <= %s', [QuotedStr(fnDateToSqlStr(dpExecuted.DateTo + edtTimeExecutedTo.Value))]) else frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and TIME_D11 <= %s', [QuotedStr(fnDateToSqlStr(dpExecuted.DateTo))]); end; frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + ' order by DATA_INS_D11 desc'; frmSQLGridFrame1.prOpenQuery; frmSQLGridFrame1.OnRowRefresh := prRowInfo; frmSQLGridFrame1.VisibleColumnsList.Values['DATA_INS_D11'] := 'Created'; end;
수정본
파일 열기
function fnGetSqlConditions(const ASqlColumnName: String; const ADatePicker: TDatePickerFrame; const ATimePickerFrom, ATimePickerTo: TTimePickerFrame): String; begin Result := ''; // filtering DATA_INS by creation date range if (ADatePicker.DateFrom <> 0) then begin if (not ATimePickerFrom.fnIsEmpty()) then Result := Result + Format(' and %s >= %s', [ASqlColumnName, QuotedStr(fnDateToSqlStr(ADatePicker.DateFrom + ATimePickerFrom.Value))]) else Result := Result + Format(' and %s >= %s', [ASqlColumnName, QuotedStr(fnDateToSqlStr(ADatePicker.DateFrom))]); end; if (ADatePicker.DateTo <> 0) then begin if (not ATimePickerTo.fnIsEmpty()) then Result := Result + Format(' and %s <= %s', [ASqlColumnName, QuotedStr(fnDateToSqlStr(ADatePicker.DateTo + ATimePickerTo.Value))]) else Result := Result + Format(' and %s <= %s', [ASqlColumnName, QuotedStr(fnDateToSqlStr(ADatePicker.DateTo))]); end; end; procedure TfmWebLogForm.prOpenSQL; const C_SQL = 'select hdl_d11, hdl_d02_d11, hdl_007_d11, hdl_d11_d11, event_d11, ' + ' time_d11, ' + ' remote_ip_d11, user_d11, session_id_d11, url_d11, content_type_d11, content_d11' + ' from tweb_srv_log_d11 d11 where' + ' d11.hdl_d11_d11 is null'; begin frmSQLGridFrame1.SQLText := C_SQL; // add query filters for: // - filtering HDL_D02 // - filtering DATA_INS by creation date range (incl time) // - filtering TIME by execution date range (incl time) // immediately after that, open query // use QuotedStr and fnDateToSqlStr(TDateTime) to format TDateTime parameters for the query // if time is not empty, use property Value to extract it from time picker // time must be added to date before casting to string //filtering HDL_D02 if (HdlD02 <> 0) then frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + Format(' and HDL_D02_D11 = %d', [HdlD02]); // filtering DATA_INS by creation date range, filtering TIME by execution date range frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + fnGetSqlConditions('DATA_INS_D11', dpCreated, edtTimeCreatedFrom, edtTimeCreatedTo) + fnGetSqlConditions('TIME_D11', dpExecuted, edtTimeExecutedFrom, edtTimeExecutedTo); frmSQLGridFrame1.SQLText := frmSQLGridFrame1.SQLText + ' order by DATA_INS_D11 desc'; frmSQLGridFrame1.prOpenQuery; frmSQLGridFrame1.OnRowRefresh := prRowInfo; frmSQLGridFrame1.VisibleColumnsList.Values['DATA_INS_D11'] := 'Created'; end;
비교하기