1 33 package smallsql.database; 34 35 36 40 class CommandUpdate extends CommandSelect { 41 42 private Expressions destinations = new Expressions(); 44 private Expressions sources = new Expressions(); 45 46 private Expression[] newRowSources; 47 48 CommandUpdate( Logger log ){ 49 super(log); 50 } 51 52 60 void addSetting(Expression dest, Expression source){ 61 columnExpressions.add(dest); 63 sources.add(source); 64 } 65 66 67 85 86 87 void executeImpl(SSConnection con, SSStatement st) throws Exception { 88 int count = columnExpressions.size(); 89 columnExpressions.addAll(sources); 90 compile(con); 91 columnExpressions.setSize(count); 92 newRowSources = sources.toArray(); 94 updateCount = 0; 95 join.execute(); 96 while(next()){ 97 updateRow( con, newRowSources); 99 updateCount++; 100 } 101 } 102 } 103 | Popular Tags |