日期:2014-05-18  浏览次数:21053 次

紧急求助:大家快来看看错误(ora-00933:SQL命令未正确结束)怎样解决?
我在用C#语言和oracle数据库来做一个数据库系统,在做通用查询模块时出现以下情况:

我写了以下两个查询语句:

1)Sql = "select ProductID as 产品图号,PlaneType as 所属机型,PlaneID as 批架次,TubeName as 产品名称,SingleNum as 单机数量,CraftRoute as 工艺路线 ,Trademark as 材料牌号,Spec as 材料规格,RoughSize as 毛料尺寸,TubeR as 导管外径,TubeThick as 材料壁厚,InputUserID as 录入者,InputDateTime as 录入时间,tubeNo as 导管编号 from SampleTubes " //前面这些在一行
+ swhere;// 这里的swhere是查询条件
   
2)Sql = "select ProductID as 产品图号,PlaneType as 所属机型,PlaneID as 批架次,BendAngle as 弯曲角度,"
  +"BenderSpeed as 弯曲模转速,PushSpeed as 助推速度,BoosterSpeed as 顶推速度,ClampForce as 夹紧力,"
  +"PressForce as 压块力,MandrelE as 芯轴伸出量,BallNumber as 球头个数,SteppedRetraction as 是否选择分段抽芯,ModelID as 模具号," //+ 后面的在一行  
  +"InputUserID as 录入者,InputDateTime as 录入时间 from TechnicsParameter"
  + swhere;
   

结果是执行第一个查询语句正常而执行第二个查询语句时报错(ora-00933:SQL命令未正确结束),请大家帮忙想想办法,不胜感激!谢谢!

------解决方案--------------------
你的swhere是一样的啊?如果是那样的话,那估计就是条件swhere在第二个SQL没有字段吧

------解决方案--------------------
参考
------解决方案--------------------
C# code

//貌似少了空格

2)Sql = "select ProductID as 产品图号,PlaneType as 所属机型,PlaneID as 批架次,BendAngle as 弯曲角度,"
      +"BenderSpeed as 弯曲模转速,PushSpeed as 助推速度,BoosterSpeed as 顶推速度,ClampForce as 夹紧力,"
        +"PressForce as 压块力,MandrelE as 芯轴伸出量,BallNumber as 球头个数,SteppedRetraction as 是否选择分段抽芯,ModelID as 模具号," //+ 后面的在一行           
  +"InputUserID as 录入者,InputDateTime as 录入时间 from TechnicsParameter    "  //here
  + swhere