国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

利用UltraEdit快速將SQL語句轉換為符合VB.NET語法格式字符串

2024-07-21 02:31:51
字體:
來源:轉載
供稿:網友

實習中時常需要將寫好的SQL語句嵌入到VB.NET的函數中,例如將下列SQL:
-- Get Mother Lot Common Info
select c.customerlotnumber -- customer lot#
,c.containername --Amkor lot#,
,amk.description
,inh.txndate indate--s_time
,outh.txndate  outdate -- e-time
,rs.resourcename resourcename
,emp.fullname
-- ,outh.qty
from container c,historymainline hml,workflowstep wfs
,Operation opt,movehistory outh,moveinhistory inh
,RESOURCEDEF rs
,amkorwwoper amk
,employee emp
where c.splitfromid =(select containerid from container where
containername='ML6410058461')
and hml.reversalstatus=1
and c.containerid=hml.containerid
and hml.operationid=opt.operationid
and hml.workflowstepid=wfs.workflowstepid
and hml.operationid=opt.operationid
and hml.historymainlineid=inh.historymainlineid(+)
and hml.historymainlineid=outh.historymainlineid(+)
and HMl.RESOURCEID=RS.RESOURCEID(+)
and (outh.historymainlineid is not null or inh.historymainlineid is not null)
and opt.amkorwwoperid=amk.amkorwwoperid
and hml.employeeid=emp.employeeid
order by c.containername,to_number(wfs.sequence),inh.txndate,outh.txndate
轉換如下形式為:
String sql in VB.NET
sql = "select c.customerlotnumber -- customer lot# " & vbCrLf _ 
  & ",c.containername --Amkor lot#, " & vbCrLf _ 
  & ",amk.description " & vbCrLf _ 
  & ",inh.txndate indate--s_time " & vbCrLf _ 
  & ",outh.txndate  outdate -- e-time " & vbCrLf _ 
  & ",rs.resourcename resourcename " & vbCrLf _ 
  & ",emp.fullname " & vbCrLf _ 
  & "-- ,outh.qty " & vbCrLf _ 
  & "from container c,historymainline hml,workflowstep wfs " & vbCrLf _ 
  & ",operation opt,movehistory outh,moveinhistory inh " & vbCrLf _ 
  & ",RESOURCEDEF rs " & vbCrLf _ 
  & ",amkorwwoper amk " & vbCrLf _ 
  & ",employee emp " & vbCrLf _ 
  & "where c.splitfromid =(select containerid from container where " & vbCrLf _ 
  & "containername='ML6410058461') " & vbCrLf _ 
  & "and hml.reversalstatus=1 " '..
同事Tracy告訴我一個快速方法,僅僅利用UltraEdit的查找替換功能(<>號不填,僅為引用號),
查找:< ^p >
替換:<  " & vbCrLf _  ^p  & " >
替換的第一個"號前不可省去空格,然后填上頭尾即可,^p代表回車符,也就是將回車符展開,是不是很有趣的技巧?

http://www.cnblogs.com/ericguo/archive/2006/11/09/555134.html


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 科尔| 长治县| 安阳县| 兴海县| 两当县| 蓝山县| 永定县| 鸡东县| 昌黎县| 贵定县| 万源市| 诸暨市| 乐东| 曲周县| 乌拉特中旗| 名山县| 屏东市| 秦皇岛市| 塔河县| 汤原县| 宁阳县| 昌邑市| 门源| 南雄市| 西藏| 北京市| 雅江县| 土默特左旗| 曲阳县| 汝州市| 巴中市| 正安县| 东乡族自治县| 桦南县| 莆田市| 深圳市| 柳林县| 麻江县| 丰城市| 刚察县| 措勤县|