Код: Выделить всё
type
TForm3 = class(TForm)
orsqlmntr1: TOraSQLMonitor;
procedure FormCreate(Sender: TObject);
Код: Выделить всё
type
TForm3 = class(TForm)
orsqlmntr1: TOraSQLMonitor;
procedure FormCreate(Sender: TObject);
But how can I use DBMonitor in case I delete it? Most of it's methods are class functions or procedures, but they want DBMonitor inside of itself!If you delete the component from the form, your sample will work correctly.
Код: Выделить всё
unit DBMonitorClient;
//...
initialization
//nothing here
finalization
DBMonitor.Free;
Код: Выделить всё
program ftDateTest;
{$APPTYPE CONSOLE}
uses
SysUtils, DB, Ora, OdacVcl;
var
oraSQL: TOraSQL;
const
sDateTime = 'ftDateTime';
sDate = 'ftDate';
sDateWith0 = 'ftDateWith0';
begin
oraSQL := TOraSQL.Create(nil);
try
oraSQL.Session := TOraSession.Create(oraSQL);
oraSQL.Session.ConnectDialog := TConnectDialog.Create(oraSQL);
if not oraSQL.Session.ConnectDialog.Execute then
Exit;
oraSQL.SQL.Text :=
Format('begin :%s := sysdate; :%s := sysdate; :%s := sysdate; end;',
[sDateTime, sDate, sDateWith0]);
oraSQL.ParamByName(sDateTime).ParamType := ptInputOutput;
oraSQL.ParamByName(sDateTime).DataType := ftDateTime;
oraSQL.ParamByName(sDate).ParamType := ptInputOutput;
oraSQL.ParamByName(sDate).DataType := ftDate;
oraSQL.ParamByName(sDateWith0).ParamType := ptInputOutput;
oraSQL.ParamByName(sDateWith0).DataType := ftDate;
oraSQL.ParamByName(sDateWith0).Value := 0;
oraSQL.Execute;
Writeln(Format('%s: "%s"', [sDateTime, oraSQL.ParamByName(sDateTime).AsString]));
Writeln(Format('%s: "%s"', [sDate, oraSQL.ParamByName(sDate).AsString]));
Writeln(Format('%s: "%s"', [sDateWith0, oraSQL.ParamByName(sDateWith0).AsString]));
Readln;
finally
oraSQL.Session.Disconnect;
oraSQL.Free;
end;
end.