Oracle comma string Stitching gadget

Source: Internet
Author: User

Oracle comma string Stitching gadget

Http://www.zui#dai#ma.com/share/1932670249667584.htm

When using Oracle for data query, it is often necessary to use the in statement, if the ID is exported in execl, do you want to write one, here is a small tool, you can quickly splicing in statements.

The code is as follows:

01 functionchangeSQL(){
02   varsrcSQL = document.getElementById("srcSQL");
03   varsrcInner = srcSQL.value;
04   varsqlBuf = "in ( "
05   
06   varnewSrc = "";
07   if(ie){
08    varnewSrc = srcInner.split("\r\n");
09   }else{
10    varpatt = newRegExp(/.+/g);
11    varnewSrc = srcInner.match(patt);
12   }
13   varlen = newSrc.length;
14   for(vari=0;i<len;i++){
15    vartemp=newSrc[i];
16    if(i < len-1){
17    sqlBuf += "\‘"+temp+"\‘"",";
18    }
19    if(i == len-1){
20    sqlBuf += "\‘"+temp+"\‘)";
21    }
22   }
23   
24   varshowSQL = document.getElementById("showSQL");
25   showSQL.innerText = sqlBuf;
26  }

01 <tableborder="1" width="350" height="450">
Geneva  < tr  align = "center" >
"    ; < td  width = "45%" >< textarea  id = "Srcsql"  rows = "" "  cols =  ></ textarea ></ td >
"    ; < TD >
   < /code>< button  onclick =  style = >< font  color = "blue"  size = "5" >< b > conversion </ b ></ button >< p >
06    
07   </td>
"    ; < td  width = "45%" >< textarea  id = "Showsql"  rows = "" "  cols =  ></ textarea ></ td >
09  </tr>
10 </table>

In fact, HTML can be changed to an. hta suffix, which is an executable file, as follows:

Guess you like it.

Oracle comma string Stitching gadget

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.