代碼:
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)')