各位好,我使用的是C#的程序,ORACLE11g R2的数据库,因为以前建立了一笔数据,因有错误又将其删除了,并已经删除了与其有关联的所有数据,包括有约束等的,全部删除了,但是现在在建立数据的时候直接就出现一错误提示,具体提示如下,请各位帮忙看看,问题是出在了那里,谢谢!could not execute query
[ SELECT this_.SYSID as SYSID66_2_, this_.VERSION as VERSION66_2_, this_.NAME as NAME66_2_, this_.DESCRIPTION as DESCRIPT4_66_2_, this_.CATEGORY as CATEGORY66_2_, this_.MEASUREMENTTYPE as MEASUREM6_66_2_, this_.DATATYPE as DATATYPE66_2_, this_.UNIT as UNIT66_2_, this_.AUTOEXCLUDE as AUTOEXCL9_66_2_, this_.UPPERSCREENINGLIMIT as UPPERSC10_66_2_, this_.LOWERSCREENINGLIMIT as LOWERSC11_66_2_, this_.UPPERSPECLIMIT as UPPERSP12_66_2_, this_.LOWERSPECLIMIT as LOWERSP13_66_2_, this_.TARGET as TARGET66_2_, edcsamplin2_.SYSID as SYSID132_0_, edcsamplin2_.VERSION as VERSION132_0_, edcsamplin2_.DESCRIPTION as DESCRIPT3_132_0_, edcsamplin2_.ISREQUIRED as ISREQUIRED132_0_, edcsamplin2_.NUMBEROFUNITS as NUMBEROF5_132_0_, edcsamplin2_.NUMBEROFSITES as NUMBEROF6_132_0_, edcsamplin2_.NUMBEROFSAMPLES as NUMBEROF7_132_0_, edcsamplin2_.MEASUREMENTSPEC as MEASUREM8_132_0_, edcstatist3_.SYSID as SYSID51_1_, edcstatist3_.VERSION as VERSION51_1_, edcstatist3_.DESCRIPTION as DESCRIPT3_51_1_, edcstatist3_.NEEDMIN as NEEDMIN51_1_, edcstatist3_.NEEDMAX as NEEDMAX51_1_, edcstatist3_.NEEDAVG as NEEDAVG51_1_, edcstatist3_.NEEDSTD as NEEDSTD51_1_, edcstatist3_.MEASUREMENTSPEC as MEASUREM8_51_1_ FROM MES_MEASUREMENTSPEC this_ left outer join MES_SAMPLINGPLAN edcsamplin2_ on this_.SYSID=edcsamplin2_.MEASUREMENTSPEC left outer join MES_STATISTICPLAN edcstatist3_ on this_.SYSID=edcstatist3_.MEASUREMENTSPEC WHERE this_.NAME = :p0 ]
Positional parameters:  #0>a
[SQL: SELECT this_.SYSID as SYSID66_2_, this_.VERSION as VERSION66_2_, this_.NAME as NAME66_2_, this_.DESCRIPTION as DESCRIPT4_66_2_, this_.CATEGORY as CATEGORY66_2_, this_.MEASUREMENTTYPE as MEASUREM6_66_2_, this_.DATATYPE as DATATYPE66_2_, this_.UNIT as UNIT66_2_, this_.AUTOEXCLUDE as AUTOEXCL9_66_2_, this_.UPPERSCREENINGLIMIT as UPPERSC10_66_2_, this_.LOWERSCREENINGLIMIT as LOWERSC11_66_2_, this_.UPPERSPECLIMIT as UPPERSP12_66_2_, this_.LOWERSPECLIMIT as LOWERSP13_66_2_, this_.TARGET as TARGET66_2_, edcsamplin2_.SYSID as SYSID132_0_, edcsamplin2_.VERSION as VERSION132_0_, edcsamplin2_.DESCRIPTION as DESCRIPT3_132_0_, edcsamplin2_.ISREQUIRED as ISREQUIRED132_0_, edcsamplin2_.NUMBEROFUNITS as NUMBEROF5_132_0_, edcsamplin2_.NUMBEROFSITES as NUMBEROF6_132_0_, edcsamplin2_.NUMBEROFSAMPLES as NUMBEROF7_132_0_, edcsamplin2_.MEASUREMENTSPEC as MEASUREM8_132_0_, edcstatist3_.SYSID as SYSID51_1_, edcstatist3_.VERSION as VERSION51_1_, edcstatist3_.DESCRIPTION as DESCRIPT3_51_1_, edcstatist3_.NEEDMIN as NEEDMIN51_1_, edcstatist3_.NEEDMAX as NEEDMAX51_1_, edcstatist3_.NEEDAVG as NEEDAVG51_1_, edcstatist3_.NEEDSTD as NEEDSTD51_1_, edcstatist3_.MEASUREMENTSPEC as MEASUREM8_51_1_ FROM MES_MEASUREMENTSPEC this_ left outer join MES_SAMPLINGPLAN edcsamplin2_ on this_.SYSID=edcsamplin2_.MEASUREMENTSPEC left outer join MES_STATISTICPLAN edcstatist3_ on this_.SYSID=edcstatist3_.MEASUREMENTSPEC WHERE this_.NAME = :p0]

解决方案 »

  1.   

    在执行之前把执行的SQL语句输出出来看一下,再拿到Oracle中直接执行一下,确认没有错误。
      

  2.   


    因为这个代码是别人给我的,很多是DLL文件,我只能调用,没有办法看,比较郁闷!
      

  3.   

    SELECT this_.SYSID as SYSID66_2_, this_.VERSION as VERSION66_2_, this_.NAME as NAME66_2_, this_.DESCRIPTION as DESCRIPT4_66_2_, this_.CATEGORY as CATEGORY66_2_, this_.MEASUREMENTTYPE as MEASUREM6_66_2_, this_.DATATYPE as DATATYPE66_2_, this_.UNIT as UNIT66_2_, this_.AUTOEXCLUDE as AUTOEXCL9_66_2_, this_.UPPERSCREENINGLIMIT as UPPERSC10_66_2_, this_.LOWERSCREENINGLIMIT as LOWERSC11_66_2_, this_.UPPERSPECLIMIT as UPPERSP12_66_2_, this_.LOWERSPECLIMIT as LOWERSP13_66_2_, this_.TARGET as TARGET66_2_, edcsamplin2_.SYSID as SYSID132_0_, edcsamplin2_.VERSION as VERSION132_0_, edcsamplin2_.DESCRIPTION as DESCRIPT3_132_0_, edcsamplin2_.ISREQUIRED as ISREQUIRED132_0_, edcsamplin2_.NUMBEROFUNITS as NUMBEROF5_132_0_, edcsamplin2_.NUMBEROFSITES as NUMBEROF6_132_0_, edcsamplin2_.NUMBEROFSAMPLES as NUMBEROF7_132_0_, edcsamplin2_.MEASUREMENTSPEC as MEASUREM8_132_0_, edcstatist3_.SYSID as SYSID51_1_, edcstatist3_.VERSION as VERSION51_1_, edcstatist3_.DESCRIPTION as DESCRIPT3_51_1_, edcstatist3_.NEEDMIN as NEEDMIN51_1_, edcstatist3_.NEEDMAX as NEEDMAX51_1_, edcstatist3_.NEEDAVG as NEEDAVG51_1_, edcstatist3_.NEEDSTD as NEEDSTD51_1_, edcstatist3_.MEASUREMENTSPEC as MEASUREM8_51_1_
    FROM MES_MEASUREMENTSPEC this_ left outer join MES_SAMPLINGPLAN edcsamplin2_ on this_.SYSID=edcsamplin2_.MEASUREMENTSPEC left outer join MES_STATISTICPLAN edcstatist3_ on this_.SYSID=edcstatist3_.MEASUREMENTSPEC 
    WHERE this_.NAME = :p0 你这个贴到 sqlplus 中可以执行吗?老实说 我眼都花了 
      

  4.   


    呵呵,谢谢,辛苦了。我看的也晕的很,因为不是自己写的代码,很多东西受限制,在SQLPLUS中执行也是错误!
      

  5.   

    plsqldev 不是有自动格式化的功能吗?。 拷到plsqldev里面运行试试。
      

  6.   


    我在TOAD中对SQL语句进行了操作,发现提示ORA-00904 this_.CATEGORY标识符无效,将这个字段去掉就可以正常执行,并且我查看了这三个表单,没有找到CATEGORY的字段存在,是否可以肯定问题就是出在了这里??因为代码是封装的我没有办法进行修改,是否可以给表中添加这个字段的办法来解决?谢谢!