oracle逗号字符串拼接小工具
时间:2021-07-01 10:21:17
帮助过:3人阅读
oracle逗号字符串拼接小工具
http://www.zui#dai#ma.com/share/1932670249667584.htm
在使用oracle进行数据查询时,常常需要使用到in语句,如果id是execl中导出的,难道要一个一个的写么,这里提供一个小工具,可以快速拼接in语句。
代码如下:
02 |
var srcSQL = document.getElementById( "srcSQL" ); |
03 |
var srcInner = srcSQL.value; |
08 |
var newSrc = srcInner.split( "\r\n" ); |
10 |
var patt = new RegExp(/.+/g); |
11 |
var newSrc = srcInner.match(patt); |
13 |
var len = newSrc.length; |
14 |
for ( var i=0;i<len;i++){ |
17 |
sqlBuf += "\‘" +temp+ "\‘" + "," ; |
20 |
sqlBuf += "\‘" +temp+ "\‘)" ; |
24 |
var showSQL = document.getElementById( "showSQL" ); |
25 |
showSQL.innerText = sqlBuf; |
01 |
< table border = "1" width = "350" height = "450" > |
03 |
< td width = "45%" >< textarea id = "srcSQL" rows = "28" cols = "60" ></ textarea ></ td > |
05 |
< button onclick = "changeSQL()" style = "cursor:hand;" >< font color = "blue" size = "5" >< b >转换</ b ></ button >< p > |
08 |
< td width = "45%" >< textarea id = "showSQL" rows = "28" cols = "60" ></ textarea ></ td > |
其实HTML可以改成.hta后缀,是可执行的文件,截图如下:
猜你喜欢
oracle逗号字符串拼接小工具
标签: