This article mainly introduces the small tool for converting javascript SQL statements into stringBuffer. it is easy to use. you only need to format the prepared SQL statements and put them in the format. we recommend it to you, if you have any need, refer. SQL is a small tool for converting SQL into stringBuffer. it is very troublesome to splice SQL at the dao layer. this tool can be used to quickly splice compiled SQL statements in the SQL tool, and then copy them in.
Demo address: http://runjs.cn/detail/fj14tpyu is a bit ugly, it is recommended to view the full screen, but you can download it to modify it yourself
Code
Change SQL
Script var ie =! -[1,]; function changeSQL () {var srcSQL = document. getElementById ("srcSQL"); var srcInner = srcSQL. value; var sqlBuf = "sqlBuf" var BufObj = "StringBuffer sqlBuf = new StringBuffer ();" var newSrc = ""; if (ie) {var newSrc = srcInner. split ("\ r \ n");} else {var patt = new RegExp (/. +/g); var newSrc = srcInner. match (patt);} var len = newSrc. length; for (var I = 0; I
The above is all the content of this article. I hope you will like it.