Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public static String constructQueryValueRemove(String table, Pair pairIndex, String column){
  2. String query;
  3. if (pairIndex.getRight() instanceof Number){
  4. query = "UPDATE `"+table+
  5. "` SET `"+column+"` = NULL" +
  6. "WHERE `"+table+"`.`"+pairIndex.getLeft()+"` = "+pairIndex.getRight();
  7. } else {
  8. query = "UPDATE `"+table+
  9. "` SET `"+column+"` = NULL" +
  10. "WHERE `"+table+"`.`"+pairIndex.getLeft()+"` = '"+pairIndex.getRight().toString()+"'";
  11. }
  12. return query;
  13. }
  14.  
  15. query = "UPDATE `"+table+"`"+
  16. "SET `"+column+"` = NULL" +
  17. "WHERE `"+table+"`.`"+pairIndex.getLeft()+"` = "+pairIndex.getRight();
Add Comment
Please, Sign In to add comment