Tips for converting SQL statements into stringBuffer using javascript _ javascript

Source: Internet
Author: User
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
 
  
 
Conversion

The above is all the content of this article. I hope you will like it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.