首页 新闻 会员 周边 捐助

VB.NET 中字符和變量連接插入oracle出現多餘的單引號。急求幫忙。。。。

0
悬赏园豆:20 [已关闭问题] 关闭于 2014-08-29 14:22

代碼:

strSQL = " insert into sz1_customer_job_import(headid,customer_number,file_name,create_date, " & _

"customer_job,cust_complete_item,cust_device,cust_product_name,FINISHITEMPACKAGENAME,Warehouseid,location,Assembly_Lot,CUSTOMER_LOT,FINISHDATECODE, " & _
  " fromoprid) values(CUSTJOB_IMPORT_S.nextval,'" & Trim("506" + "_") & "','" & Right(sFile, sFile.Length - strProcessFilePath.Length - 1) & "',sysdate, " & _
                                checkDBNull(xlsSheet.cells(i, 3).value, "S") & "," & _
                                checkDBNull(xlsSheet.cells(i, 15).value, "S") & "," & _
                               "'" & Trim(checkDBNull(xlsSheet.cells(i, 15).value, "S").Trim() + "_" + checkDBNull(xlsSheet.cells(i, 17).value, "S").Trim() + "_" + checkDBNull(xlsSheet.cells(i, 18).value, "S").Trim()) & "'," & _
                               "'" & Trim(checkDBNull(xlsSheet.cells(i, 15).value, "S").Trim() + "_" + checkDBNull(xlsSheet.cells(i, 17).value, "S").Trim() + "_" + checkDBNull(xlsSheet.cells(i, 18).value, "S").Trim()) & "'," & _
                                checkDBNull(xlsSheet.cells(i, 23).value, "S") & "," & _
                                checkDBNull(xlsSheet.cells(i, 33).value, "S") & "," & _
                                checkDBNull(xlsSheet.cells(i, 34).value, "S") & "," & _
                                checkDBNull(xlsSheet.cells(i, 42).value, "S") & "," & _
                                checkDBNull(xlsSheet.cells(i, 44).value, "S") & "," & _
                                checkDBNull(xlsSheet.cells(i, 45).value, "S") & "," & _
                                checkDBNull(xlsSheet.cells(i, 50).value, "S") & _
                                ")"

運行出來的sql就變成下面這樣,不知道怎樣去掉這些單引號,弄了半天了。。。

insert into sz1_customer_job_import(headid,customer_number,file_name,create_date,  customer_job,cust_complete_item,cust_device,cust_product_name,FINISHITEMPACKAGENAME,Warehouseid,location,Assembly_Lot,CUSTOMER_LOT,FINISHDATECODE,  fromoprid) values(CUSTJOB_IMPORT_S.nextval,'506_','701PO-100018509.csv',sysdate, '701PO-100018509','Pm25LD020-ECE-TR',''Pm25LD020-ECE-TR'_'FSH022A0'_'N'',''Pm25LD020-ECE-TR'_'FSH022A0'_'N'','VVSOP 150 MIL, LEAD FREE','MN.SC.ZKT','FG-ZKT','HQTL9.00','HQTL900L1','1433','TURNKEY(AS+FT-TR)')

 

smilehuiru的主页 smilehuiru | 初学一级 | 园豆:177
提问于:2014-08-29 14:17
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册