Code: Select all
procedure TForm2.Button1Click(Sender: TObject);
begin
OraScript1.SQL.Text :=
'WITH' + #13#10 +
' FUNCTION with_function(p_id IN NUMBER) RETURN NUMBER IS' + #13#10 +
' BEGIN' + #13#10 +
' RETURN p_id;' + #13#10 +
' END;' + #13#10 +
'SELECT with_function(1)' + #13#10 +
'FROM dual' + #13#10 +
'/';
ShowMessage(IntToStr(OraScript1.Statements.Count)); // SHOWED 3 instead 1
end;