private async Task <string> GetSources(OracleStackTraceItem activeItem, CancellationToken cancellationToken) { _debuggerSessionCommand.CommandText = "SELECT TYPE, LINE, TEXT FROM DBA_SOURCE WHERE OWNER = :OWNER AND NAME = :NAME AND TYPE IN ('FUNCTION', 'JAVA SOURCE', 'LIBRARY', 'PACKAGE BODY', 'PROCEDURE', 'TRIGGER', 'TYPE BODY', 'TYPE') ORDER BY TYPE, LINE"; _debuggerSessionCommand.Parameters.Clear(); _debuggerSessionCommand.AddSimpleParameter("OWNER", activeItem.Owner); _debuggerSessionCommand.AddSimpleParameter("NAME", activeItem.Name); using (var reader = await _debuggerSessionCommand.ExecuteReaderAsynchronous(CommandBehavior.Default, cancellationToken)) { var sourceBuilder = new StringBuilder("CREATE "); while (await reader.ReadAsynchronous(cancellationToken)) { sourceBuilder.Append((string)reader["TEXT"]); } return(sourceBuilder.ToString()); } }
private async Task<string> GetSources(OracleStackTraceItem activeItem, CancellationToken cancellationToken) { _debuggerSessionCommand.CommandText = "SELECT TYPE, LINE, TEXT FROM DBA_SOURCE WHERE OWNER = :OWNER AND NAME = :NAME AND TYPE IN ('FUNCTION', 'JAVA SOURCE', 'LIBRARY', 'PACKAGE BODY', 'PROCEDURE', 'TRIGGER', 'TYPE BODY', 'TYPE') ORDER BY TYPE, LINE"; _debuggerSessionCommand.Parameters.Clear(); _debuggerSessionCommand.AddSimpleParameter("OWNER", activeItem.Owner); _debuggerSessionCommand.AddSimpleParameter("NAME", activeItem.Name); using (var reader = await _debuggerSessionCommand.ExecuteReaderAsynchronous(CommandBehavior.Default, cancellationToken)) { var sourceBuilder = new StringBuilder("CREATE "); while (await reader.ReadAsynchronous(cancellationToken)) { sourceBuilder.Append((string)reader["TEXT"]); } return sourceBuilder.ToString(); } }