我一遍又一遍地得到同样的东西。 我不能使用绑定参数,因为我有一些原因 但我只是使用普通的字符串查询插入并更新它给出了日期转换错误。
我已检查过我的登录帐户默认语言是英语。
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: The conversion of a varchar data type to a smalldatetime data type resulted in an out-of-range value.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:246)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:83)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1488)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:775)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:676)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4874)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(SQLServerStatement.java:633)
at syncproject.icstkFunctions.sendGet(icstkFunctions.java:2007)
at syncproject.icstkFunctions.mainRunner(icstkFunctions.java:52)
at syncproject.MainMenuFunctions.MainMenu(MainMenuFunctions.java:73)
at syncproject.SyncProject.main(SyncProject.java:15)
C:\ Users \ User \ AppData \ Local \ NetBeans \ Cache \ 8.2 \ executor-snippets \ run.xml:53:Java返回:1 建筑失败(总时间:3秒)
IF EXISTS (
SELECT code
FROM icstk
WHERE code = '000000'
)
UPDATE icstk
SET code = '000000'
,group1 = '0001'
,desc1 = 'DISPENSING'
,shrdesc = 'DISPENSING'
,unit = 'EACH'
,photo = ''
,remark = ''
,supitem = ''
,location = ''
,dfrdate = '0000-00-00 00:00:00'
,dtodate = '0000-00-00 00:00:00'
,ldate = '2017-04-02 00:00:00'
,lprice = '0.0000'
,openbal = '-433.00'
,maximum = '25.00'
,minimum = '4.00'
,cprice = '0.0000'
,uprice = '1.00'
,reorder = '9.00'
,addqty1 = '0.00'
,addqty2 = '0.00'
,addqty3 = '0.00'
,addqty4 = '0.00'
,addqty5 = '0.00'
,addqty6 = '0.00'
,addqty7 = '0.00'
,addqty8 = '0.00'
,addqty9 = '0.00'
,addqty10 = '0.00'
,addqty11 = '0.00'
,addqty12 = '0.00'
,dedqty1 = '35.00'
,dedqty2 = '22.00'
,dedqty3 = '24.00'
,dedqty4 = '22.00'
,dedqty5 = '49.00'
,dedqty6 = '22.00'
,dedqty7 = '42.00'
,dedqty8 = '32.00'
,dedqty9 = '28.00'
,dedqty10 = '16.00'
,dedqty11 = '24.01'
,dedqty12 = '0.00'
,adjqty1 = '0.00'
,adjqty2 = '0.00'
,adjqty3 = '0.00'
,adjqty4 = '0.00'
,adjqty5 = '0.00'
,adjqty6 = '0.00'
,adjqty7 = '0.00'
,adjqty8 = '0.00'
,adjqty9 = '0.00'
,adjqty10 = '0.00'
,adjqty11 = '0.00'
,adjqty12 = '0.00'
,addyqty = '0.00'
,dedyqty = '316.01'
,adjyqty = '0.00'
,minprice = '2.00'
,repack = 'N'
,totalval = '0.00'
,presc1 = ''
,presc2 = ''
,presc3 = ''
,qty = '0.00'
,poison = ''
,manufact = ''
,expdate = 'N'
,defuom = 'EACH'
,LastPurgeDate = '0000-00-00 00:00:00'
,Purge_pivot_date = '0000-00-00 00:00:00'
,Purge_Balance = '0'
,weighted_average_price = '0'
,Lastadd = '6'
,Returnable_Exchangable = ''
,Returnable_Exchangable_Status = 'E'
,nonactive_item = 'N'
,Disc = '0'
,Pfrdate = '1900-01-01 00:00:00'
,Ptodate = '1900-01-01 00:00:00'
,DiscRM = '0'
,Special_Register = 'N'
,Psychotopic = 'N'
,StatID = '0'
,Point = '0'
,Wholesales_DiscAmt = '0'
,Wholesales_DiscPerc = '0'
,ChkBalance_Status = 'Y'
,NewStkCode = 'N'
,EditStatus = 'Y'
,NotChkSellBelowAvCost = 'N'
,Dispensing_Item = 'N'
,Member_Disc = 'Y'
,WhRetail = '0'
,WhPharmacy = '0'
,WhBranch = '0'
,WhClinic = '0'
,Other1 = '0'
,Other2 = '0'
,CommRM = '0'
,CommPerc = '0'
,QtytoOrder = '0'
,EditTranStatus = 'N'
,TouchBtnPage = '1'
,TouchBtnSeqNo = '1'
,ScaleItem = 'N'
,FactorRate = '0'
,shrdesc2 = ''
,shrdesc3 = ''
,SpecialDate = '1900-01-01 00:00:00'
,PsychotropicsDate = '1900-01-01 00:00:00'
,EditTransDate = '2017-11-23 00:00:00'
,Cls_date = '0000-00-00 00:00:00'
,Cls_Balance = '0'
,Cls_AvCost = '0'
,StkModifyDate = '2017-10-30 00:00:00'
,EnterBillCost = 'N'
,Retrieve_Weight = 'N'
,NotAppearStkReorderRpt = 'Y'
,MultiUomDisc = '0'
,redempt_item = 'N'
,RedemptPoint = '0'
,Location2 = ''
,SynPrice_Disc = 'Y'
,TemplateCode = ''
,MasterRunNo = '1'
,GrpRunNo = '1'
,StkRunNo = '1'
,GSTCode = 'SR'
,Tax1 = 'Y'
,Tax2 = 'N'
,Tax3 = 'N'
,Tax4 = 'N'
,Tax5 = 'N'
,GSTPurchaseCode = 'TX'
,ExcluseUCost = '17.5591'
,average_Excludeprice = '17.6'
,Cls_ExcluseAvCost = '0'
,ExportShopify = 'N'
,Serv_Tax = '0'
,Serv_Status = 'N'
,DN_Status = 'N'
,Subsidy = ''
,NotIncludePointValue = 'N'
,illness1 = ''
,presc4 = ''
,presc5 = ''
,presc6 = ''
,presc7 = ''
,presc8 = ''
,presc9 = ''
,GenericName = ''
,WKRetail = '0'
,WKPharmacy = '0'
,WKBranch = '0'
,WKClinic = '0'
,WKOther1 = '0'
,WKOther2 = '0'
,SalesMargin = '0'
,StkType = ''
,TransportItem = ''
,PlasticBagStatus = ''
,Package_Code = ''
,MedicineStrength = ''
,MedicalChkStatus = ''
WHERE code = '000000'
ELSE
INSERT INTO icstk (
code
,group1
,desc1
,shrdesc
,unit
,photo
,remark
,supitem
,location
,dfrdate
,dtodate
,ldate
,lprice
,openbal
,maximum
,minimum
,cprice
,uprice
,reorder
,addqty1
,addqty2
,addqty3
,addqty4
,addqty5
,addqty6
,addqty7
,addqty8
,addqty9
,addqty10
,addqty11
,addqty12
,dedqty1
,dedqty2
,dedqty3
,dedqty4
,dedqty5
,dedqty6
,dedqty7
,dedqty8
,dedqty9
,dedqty10
,dedqty11
,dedqty12
,adjqty1
,adjqty2
,adjqty3
,adjqty4
,adjqty5
,adjqty6
,adjqty7
,adjqty8
,adjqty9
,adjqty10
,adjqty11
,adjqty12
,addyqty
,dedyqty
,adjyqty
,minprice
,repack
,totalval
,presc1
,presc2
,presc3
,qty
,poison
,manufact
,expdate
,defuom
,LastPurgeDate
,Purge_pivot_date
,Purge_Balance
,weighted_average_price
,Lastadd
,Returnable_Exchangable
,Returnable_Exchangable_Status
,nonactive_item
,Disc
,Pfrdate
,Ptodate
,DiscRM
,Special_Register
,Psychotopic
,StatID
,Point
,Wholesales_DiscAmt
,Wholesales_DiscPerc
,ChkBalance_Status
,NewStkCode
,EditStatus
,NotChkSellBelowAvCost
,Dispensing_Item
,Member_Disc
,WhRetail
,WhPharmacy
,WhBranch
,WhClinic
,Other1
,Other2
,CommRM
,CommPerc
,QtytoOrder
,EditTranStatus
,TouchBtnPage
,TouchBtnSeqNo
,ScaleItem
,FactorRate
,shrdesc2
,shrdesc3
,SpecialDate
,PsychotropicsDate
,EditTransDate
,Cls_date
,Cls_Balance
,Cls_AvCost
,StkModifyDate
,EnterBillCost
,Retrieve_Weight
,NotAppearStkReorderRpt
,MultiUomDisc
,redempt_item
,RedemptPoint
,Location2
,SynPrice_Disc
,TemplateCode
,MasterRunNo
,GrpRunNo
,StkRunNo
,GSTCode
,Tax1
,Tax2
,Tax3
,Tax4
,Tax5
,GSTPurchaseCode
,ExcluseUCost
,average_Excludeprice
,Cls_ExcluseAvCost
,ExportShopify
,Serv_Tax
,Serv_Status
,DN_Status
,Subsidy
,NotIncludePointValue
,illness1
,presc4
,presc5
,presc6
,presc7
,presc8
,presc9
,GenericName
,WKRetail
,WKPharmacy
,WKBranch
,WKClinic
,WKOther1
,WKOther2
,SalesMargin
,StkType
,TransportItem
,PlasticBagStatus
,Package_Code
,MedicineStrength
,MedicalChkStatus
)
VALUES (
'000000'
,'0001'
,'DISPENSING'
,'DISPENSING'
,'EACH'
,''
,''
,''
,''
,'0000-00-00 00:00:00'
,'0000-00-00 00:00:00'
,'2017-04-02 00:00:00'
,'0.0000'
,'-433.00'
,'25.00'
,'4.00'
,'0.0000'
,'1.00'
,'9.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'35.00'
,'22.00'
,'24.00'
,'22.00'
,'49.00'
,'22.00'
,'42.00'
,'32.00'
,'28.00'
,'16.00'
,'24.01'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'0.00'
,'316.01'
,'0.00'
,'2.00'
,'N'
,'0.00'
,''
,''
,''
,'0.00'
,''
,''
,'N'
,'EACH'
,'0000-00-00 00:00:00'
,'0000-00-00 00:00:00'
,'0'
,'0'
,'6'
,''
,'E'
,'N'
,'0'
,'1900-01-01 00:00:00'
,'1900-01-01 00:00:00'
,'0'
,'N'
,'N'
,'0'
,'0'
,'0'
,'0'
,'Y'
,'N'
,'Y'
,'N'
,'N'
,'Y'
,'0'
,'0'
,'0'
,'0'
,'0'
,'0'
,'0'
,'0'
,'0'
,'N'
,'1'
,'1'
,'N'
,'0'
,''
,''
,'1900-01-01 00:00:00'
,'1900-01-01 00:00:00'
,'2017-11-23 00:00:00'
,'0000-00-00 00:00:00'
,'0'
,'0'
,'2017-10-30 00:00:00'
,'N'
,'N'
,'Y'
,'0'
,'N'
,'0'
,''
,'Y'
,''
,'1'
,'1'
,'1'
,'SR'
,'Y'
,'N'
,'N'
,'N'
,'N'
,'TX'
,'17.5591'
,'17.6'
,'0'
,'N'
,'0'
,'N'
,'N'
,''
,'N'
,''
,''
,''
,''
,''
,''
,''
,''
,'0'
,'0'
,'0'
,'0'
,'0'
,'0'
,'0'
,''
,''
,''
,''
,''
,''
)
答案 0 :(得分:1)
documentation for smalldatetime表示该类型的有效值范围是
日期范围1900-01-01至2079-06-06
您显然试图将0000-00-00 00:00:00
存储在此类列中,这是“超出范围的值”。