Caption := Caption +
' '
+FormatDateTime(
'hh:mm:ss'
, Now);
CoInitialize(
nil
);
FDQConn := TFDConnection
.
Create(
nil
);
FDPhysPgDriverLinkPg := TFDPhysPgDriverLink
.
Create(
nil
);
FDQSql := TFDQuery
.
Create(
nil
);
FDPhysPgDriverLinkPg
.
Release;
FDPhysPgDriverLinkPg
.
DriverID :=
'PG_'
;
FDPhysPgDriverLinkPg
.
VendorLib :=
'x:\xxxx\xxxxxxxx\xxxxxxxx\libpq.dll'
;
FDQConn
.
DriverName :=
'PG'
;
FDQConn
.
Params
.
Database :=
'xxxxxx'
;
FDQConn
.
Params
.
DriverID :=
'PG_'
;
FDQConn
.
Params
.
Password := 'xxxxx;
FDQConn
.
Params
.
UserName :=
'xxxxx'
;
FDQConn
.
Params
.
Add(
'Server=XXXXX-XXXXXX0678'
);
FDQConn
.
ResourceOptions
.
ServerOutput :=
True
;
try
FDQConn
.
Connected :=
True
;
while
not
FDQConn
.
Connected
do
begin
end
;
if
FDQConn
.
Connected
then
begin
FDQSql
.
Connection := FDQConn;
with
FDQSql
.
SQL
do
begin
Clear;
Add(
'begin;'
);
Add(
'select storedproc15('
'2019-09-01'
','
'2019-09-05'
', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '
'acur'
');'
);
Add(
'FETCH ALL IN acur;'
);
end
;
FDQSql
.
Active :=
True
;
end
;
ShowMessage(
'21'
);