M
mhlijd
Unregistered / Unconfirmed
GUEST, unregistred user!
版本 Delphi 6: update3
描述:
c/s结构,BDE 5.1. 使用Tquery, TClientDataSet, TDataSetProvider.
其中DataSetProvider的属性设置:UpdateMode:=[upWhereKeyOnly];ResolveToDataset:=False;Options:=[poIncFieldProps,poCascadeDeletes,poCascadeUpdates,poAllowMultiRecordUpdates];
当数据修改结束后,调用 ClientDataSet1.ApplyUpdates(-1);
可以修改数据,但是只能修改一条记录(偶尔可以有2条),在sql monitor中观察,得到类似下面结果:
14:32:42 SQL 等等
14:32:42 SQL Execute: DB2 - update "PDGCGL_PDXMXX" set "CENGINEER_NUMBER" = ?,
"CENGINEER_NAME" = ?
where
"IENGINEER_CODE" = ?
9 14:32:42 SQL Vendor: DB2 - SQLBindParameter
10 14:32:42 SQL Vendor: DB2 - SQLBindParameter
11 14:32:42 SQL Vendor: DB2 - SQLBindParameter
12 14:32:42 SQL Vendor: DB2 - SQLExecute
13 14:32:42 SQL Vendor: DB2 - SQLNumResultCols
14 14:32:42 SQL Vendor: DB2 - SQLRowCount
15 14:32:42 SQL Data In: DB2 - Rows affected = 1
等等
14:32:42 SQL Execute: DB2 - update "PDGCGL_PDXMXX" set
"CENGINEER_NUMBER" = ?,
"CENGINEER_NAME" = ?
where
"IENGINEER_CODE" = ?
Prepare: DB2 - update "PDGCGL_PDXMXX" set "CENGINEER_NUMBER" ?,
"CENGINEER_NAME" = ?
where
"IENGINEER_CODE" = ?
22 14:32:42 SQL Vendor: DB2 - SQLBindParameter
23 14:32:42 SQL Error: DB2 -
24 14:32:42 SQL Error: DB2 - Unmapped SQL Error Code: 0
估计是没有Prepare: DB2 引起的,这个问题怎么解决?
BTW:2层结构.
数据库 DB25.2
描述:
c/s结构,BDE 5.1. 使用Tquery, TClientDataSet, TDataSetProvider.
其中DataSetProvider的属性设置:UpdateMode:=[upWhereKeyOnly];ResolveToDataset:=False;Options:=[poIncFieldProps,poCascadeDeletes,poCascadeUpdates,poAllowMultiRecordUpdates];
当数据修改结束后,调用 ClientDataSet1.ApplyUpdates(-1);
可以修改数据,但是只能修改一条记录(偶尔可以有2条),在sql monitor中观察,得到类似下面结果:
14:32:42 SQL 等等
14:32:42 SQL Execute: DB2 - update "PDGCGL_PDXMXX" set "CENGINEER_NUMBER" = ?,
"CENGINEER_NAME" = ?
where
"IENGINEER_CODE" = ?
9 14:32:42 SQL Vendor: DB2 - SQLBindParameter
10 14:32:42 SQL Vendor: DB2 - SQLBindParameter
11 14:32:42 SQL Vendor: DB2 - SQLBindParameter
12 14:32:42 SQL Vendor: DB2 - SQLExecute
13 14:32:42 SQL Vendor: DB2 - SQLNumResultCols
14 14:32:42 SQL Vendor: DB2 - SQLRowCount
15 14:32:42 SQL Data In: DB2 - Rows affected = 1
等等
14:32:42 SQL Execute: DB2 - update "PDGCGL_PDXMXX" set
"CENGINEER_NUMBER" = ?,
"CENGINEER_NAME" = ?
where
"IENGINEER_CODE" = ?
Prepare: DB2 - update "PDGCGL_PDXMXX" set "CENGINEER_NUMBER" ?,
"CENGINEER_NAME" = ?
where
"IENGINEER_CODE" = ?
22 14:32:42 SQL Vendor: DB2 - SQLBindParameter
23 14:32:42 SQL Error: DB2 -
24 14:32:42 SQL Error: DB2 - Unmapped SQL Error Code: 0
估计是没有Prepare: DB2 引起的,这个问题怎么解决?
BTW:2层结构.
数据库 DB25.2