Given the following script:
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello');
END;
Can Unidac capture the output, and if so, how? Thanks in advance.
Possible to capture output from DBMS_OUTPUT.PUT_LINE?
Re: Possible to capture output from DBMS_OUTPUT.PUT_LINE?
The following code snippet demonstrates demonstrates working with the DBMS_Output package :
...
...
...
Code: Select all
var
Query: TUniQuery;
begin
UniConnection.Connect;
Query := TUniQuery.Create(Nil);
try
Query.Connection := UniConnection;
Query.SQL.Text := 'Begin DBMS_Output.Enable(20000); End;';
Query.Execute;
// DBMS_Output.Put_Line
Query.SQL.Text := 'Begin DBMS_Output.Put_Line(''Hello''); End;';
Query.Execute;
// DBMS_Output.Get_Line
Query.SQL.Text := 'Begin DBMS_Output.Get_Line(:LineValue, :Status); End;';
Query.ParamByName('LineValue').ParamType := ptOutput;
Query.ParamByName('LineValue').DataType := ftString;
Query.ParamByName('Status').ParamType := ptOutput;
Query.ParamByName('Status').DataType := ftInteger;
Query.Execute;
ShowMessage(Query.ParamByName('LineValue').AsString);
finally
Query.Free;
end;
end;
Re: Possible to capture output from DBMS_OUTPUT.PUT_LINE?
Got it, thanks.