{解析出sql語句}
function TForm
var
i
s
Cmdstr: string;
FieldList
Cdsupdate: TClientDataSet;
sqlstr: WideString;
ado: TADOQuery;
begin
if varisnull(pdelta) then
Exit;
Cdsupdate:=TClientDataSet
Cdsupdate
if not Cdsupdate
Cdsupdate
try
FieldList:=TstringList
Keylist:=TstringList
Keylist
Keylist
ado:=TADOQuery
ado
ado
ado
ado
ado
for i:=
if Cdsupdate
Cdsupdate
FieldList
if Cdsupdate
begin
Cdsupdate
s
s
while not Cdsupdate
begin
Cmdstr:=
case Cdsupdate
usUnmodified: //從原數據行取得修改條件
begin
s
for j:=
begin
if s
s
else
s
end;
end;
usModified:
begin
s
for i:=
begin
if (not Cdsupdate
begin
if s
s
else
s
end;
end;
if s
begin
Cmdstr:=
end;
end;
usInserted:
begin
s
s
for i:=
if (not Cdsupdate
begin
if s
begin
s
s
end
else
begin
s
s
end;
end;
if s
begin
Cmdstr:=
end;
end;
usDeleted:
begin
s
for j:=
begin
if s
s
else
s
end;
Cmdstr:=
end;
end;
if Cmdstr<>
sqlstr:=sqlstr+Cmdstr+
Cdsupdate
end;
end;
finally
Cdsupdate
Cdsupdate
end;
Result:=sqlstr;
end;
From:http://tw.wingwit.com/Article/program/Oracle/201311/17878.html