有这样的一条语句,在运行时报错为,
OracleException: ORA-01008: 并非所有变量都已关联
语句是这样的
string strtmp1 = "select no,Up_date,Dis_date,UP,DIS,type,class,Comments,id from tb_base where  no=:no and up=:up and dis=:dis";
请问这是什么原因!
谢谢

解决方案 »

  1.   

    你查询返回的数值有九个:no,Up_date,Dis_date,UP,DIS,type,class,Comments,id ,而你只有一个变量strtmp1.
      

  2.   

    应该不是这个原因吧!
    strtemp1 是一个变量,但是我觉得,问题应该是在后面的语句里!:(
      

  3.   

    Cause: A SQL statement containing substitution variables was executed without all variables bound. All substitution variables must have a substituted value before the SQL statement is executed. Action: In OCI, use an OBIND or OBINDN call to substitute the required values. 问题应该出在绑定变量上。你的三个变量都绑定了吗?
    DBMS_SQL.BIND_VARIABLE(v_Cursor,':no',v_StartDate);             
    DBMS_SQL.BIND_VARIABLE(v_Cursor,':up',v_StartDate);             
    DBMS_SQL.BIND_VARIABLE(v_Cursor,':dis',v_StartDate);        
      

  4.   

    我是用droplist 绑定的,这样写可以吗?