Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
实时编辑器
隐藏空白更改
折叠未更改行
关闭换行
视图
拆分
统一
比对精度
智能
单词
字符
文本样式
更改外观
语法高亮
选择语法
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取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;
查找差异