57 |
|
var Transaction, Transaction2, Transaction3: ITransaction; |
58 |
|
Statement: IStatement; |
59 |
|
Rows: IResultSet; |
60 |
+ |
stats: TPerfCounters; |
61 |
|
begin |
62 |
|
Transaction := Attachment.StartTransaction([isc_tpb_write,isc_tpb_nowait,isc_tpb_concurrency],taRollback); |
63 |
|
Statement := Attachment.Prepare(Transaction,'Update Employee Set Hire_Date = ? Where EMP_NO = ?',3); |
69 |
|
Transaction.Start(TARollback); |
70 |
|
|
71 |
|
Statement := Attachment.PrepareWithNamedParameters(Transaction,'Select * from EMPLOYEE Where EMP_NO = :EMP_NO',3); |
72 |
+ |
Statement.EnableStatistics(true); |
73 |
|
Statement.GetSQLParams.ByName('EMP_NO').AsInteger := 8; |
74 |
|
ReportResults(Statement); |
75 |
+ |
if Statement.GetPerfStatistics(stats) then |
76 |
+ |
WritePerfStats(stats); |
77 |
|
|
78 |
|
Statement := Attachment.PrepareWithNamedParameters(Transaction,'INSERT INTO EMPLOYEE (EMP_NO, FIRST_NAME, LAST_NAME, PHONE_EXT, HIRE_DATE,' + |
79 |
|
'DEPT_NO, JOB_CODE, JOB_GRADE, JOB_COUNTRY, SALARY) '+ |
85 |
|
ByName('FIRST_NAME').AsString := 'John'; |
86 |
|
ByName('LAST_NAME').AsString := 'Doe'; |
87 |
|
ByName('PHONE_EXT').AsString := ''; |
88 |
< |
ByName('HIRE_DATE').AsDateTime := EncodeDate(2015,4,1);; |
88 |
> |
ByName('HIRE_DATE').AsDateTime := EncodeDate(2015,4,1); |
89 |
|
ByName('DEPT_NO').AsString := '600'; |
90 |
|
ByName('JOB_CODE').AsString := 'Eng'; |
91 |
|
ByName('JOB_GRADE').AsInteger := 4; |