We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql语句如下; StringBuffer sb = new StringBuffer(""); sb.append("if (select count(*) from CorpLogin where CorpID = " + corpWeb.getCorpID() + ") = 0 "); sb.append(" insert into CorpLogin(corpID,WebLoginDate,WebLoginTimes) values (" + corpWeb.getCorpID() + ",getDate(),1)"); sb.append("else"); sb.append(" update CorpLogin set WebLoginDate =getDate(),WebLoginTimes=WebLoginTimes+1 where corpId =" + corpWeb.getCorpID() + ""); Sql sql = Sqls.create(sb.toString()); dao.execute(sql); 异常: org.nutz.mvc.impl.processor.FailProcessor - Catch handle error org.nutz.dao.DaoException: java.lang.RuntimeException: r u kidding me?! It is impossible! at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:74) at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:178) at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:169)
The text was updated successfully, but these errors were encountered:
大哥,为啥不分成几个 SQL 写涅? 效率差很多吗? 这样反而更不好让 DBA 优化吧
Sorry, something went wrong.
呵呵。这句在1.37里是好的。
1.38 里 Sql sql = Sqls.create("select count(*) as c from corp a inner join web b on a.id = b.Corpid where a.id =1"); dao.execute(sql);
出错了,换成 fetchInt 就可以了 Sql sql = Sqls.fetchInt("select count(*) as c from corp a inner join web b on a.id = b.Corpid where a.id =1"); dao.execute(sql);
Wendal~兽:估计是因为没有加入默认callback
1.b.38 对 SQL 做了稍微严格的检查, 我认为如果未知类型,就直接执行而不抛错就是了 在 1.b.39 里改一下吧
Fixed Issue #13
8222831
zozoh
No branches or pull requests
sql语句如下;
StringBuffer sb = new StringBuffer("");
sb.append("if (select count(*) from CorpLogin where CorpID = " + corpWeb.getCorpID() + ") = 0 ");
sb.append(" insert into CorpLogin(corpID,WebLoginDate,WebLoginTimes) values (" + corpWeb.getCorpID() + ",getDate(),1)");
sb.append("else");
sb.append(" update CorpLogin set WebLoginDate =getDate(),WebLoginTimes=WebLoginTimes+1 where corpId =" + corpWeb.getCorpID() + "");
Sql sql = Sqls.create(sb.toString());
dao.execute(sql);
异常:
org.nutz.mvc.impl.processor.FailProcessor - Catch handle error
org.nutz.dao.DaoException: java.lang.RuntimeException: r u kidding me?! It is impossible!
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:74)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:178)
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:169)
The text was updated successfully, but these errors were encountered: