73 |
|
Transaction.Rollback; |
74 |
|
Transaction.Start(TARollback); |
75 |
|
|
76 |
< |
Statement := Attachment.PrepareWithNamedParameters(Transaction,'Select * from EMPLOYEE Where EMP_NO = :EMP_NO',3); |
76 |
> |
Statement := Attachment.PrepareWithNamedParameters(Transaction,'Select * from EMPLOYEE Where EMP_NO = :F1',3); |
77 |
|
Statement.EnableStatistics(true); |
78 |
< |
Statement.GetSQLParams.ByName('EMP_NO').AsInteger := 8; |
78 |
> |
Statement.GetSQLParams.ByName('F1').AsInteger := 8; |
79 |
|
ReportResults(Statement); |
80 |
|
if Statement.GetPerfStatistics(stats) then |
81 |
|
WritePerfStats(stats); |
194 |
|
writeln(OutFile,'Same Statement - updated params'); |
195 |
|
Statement.GetSQLParams.ByName('EMP_NO').AsInteger := 9; |
196 |
|
ReportResults(Statement); |
197 |
+ |
|
198 |
+ |
writeln(outfile,'Test using Execute Block'); |
199 |
+ |
|
200 |
+ |
Transaction := Attachment.StartTransaction([isc_tpb_write,isc_tpb_nowait,isc_tpb_concurrency],taRollback); |
201 |
+ |
Statement := Attachment.PrepareWithNamedParameters(Transaction, |
202 |
+ |
'Execute Block (Hired Timestamp = :Hire_Date, empno integer = :EMP_NO) '+ |
203 |
+ |
'As Begin ' + |
204 |
+ |
' Update Employee Set Hire_Date = :Hired Where EMP_NO = :empno; '+ |
205 |
+ |
'End' |
206 |
+ |
,3); |
207 |
+ |
Statement.GetSQLParams.ByName('Hire_Date').AsDateTime := EncodeDate(2015,1,31);; |
208 |
+ |
Statement.GetSQLParams.ByName('EMP_NO').AsInteger := 8; |
209 |
+ |
Statement.Execute; |
210 |
+ |
WriteAffectedRows(Statement); |
211 |
+ |
Statement := Attachment.PrepareWithNamedParameters(Transaction,'Select * from EMPLOYEE Where EMP_NO = :EMP_NO',3); |
212 |
+ |
Statement.GetSQLParams.ByName('EMP_NO').AsInteger := 8; |
213 |
+ |
ReportResults(Statement); |
214 |
+ |
|
215 |
|
end; |
216 |
|
|
217 |
|
function TTest4.TestTitle: AnsiString; |