main(){ connectionString = database OracleConnection connection = new OracleConnection(connectionString); connection.open(); OracleCommand cmd = connection.CreateCommand; OracleTransaction transaction; transaction = connection.BeginTransaction try { cmd.CommandText = INSERT INTO TableA... cmd.ExecuteNonQuery OracleReader reader = SELECT a, b, c FROM... // could be many hundred of rows while(reader.Read()) { insertString.append("INSERT INTO TableB VALUES ("); insertString.append("'" + a + "', '" + b + "', "); int i1 = method1(connectionString) insertString.append(i1 + ", "); int i2 = method2(connectionString); insertString.append(i2 + ")"); cmd.CommandText = insertString.ToString(); cmd.ExecuteNonQuery; } transaction.Commit(); } catch { transaction.Rollback(); } finally { connection.Close(); }} method1(string connectionString){ OracleConnection connection = new OracleConnection(connectionString); connection.open(); try { ... return (int)(OracleNumber)cmd.ExecuteOracleScalar(); } catch { return integer; } finally { connection.close(); }} method2(string connectionString){ OracleConnection connection = new OracleConnection(connectionString); connection.open(); try { ... return (int)(OracleNumber)cmd.ExecuteOracleScalar(); } catch { return integer; } finally { connection.close(); }}