pl/sql sql Oracle DRA-01008并非所有变量都已绑定

这个大佬能看看这中间有什么毛病嘛
图片说明

这边是我的sql语句

 Select a.*
  From (select /*+first_rows*/
         wi.iid as 顺序号,
         w.wname as 案件类型,
         i.name as 名称,
         x.联系人 as 联系人,
         wi.accepted_time as 接收时间,
         wi.submit_time as 提交时间,
         (Select user_name From st_user Where userid = wi.senduserid) as 前一用户,
         wi.wiid,
         wi.step as 所在岗位,
         x.业务类型id as BusinessId
          from ST_WORK_ITEM_HIST wi,
               xt_instance       x,
               st_instance       i,
               st_workflow       w
         where wi.iid = x.iid
           and x.iid = i.iid
           and i.wid = w.wid
           and wi.userid = :userId
           and x.业务类型id in
               (select id from sys_business_type b where b.type = :type)
         order by wi.accepted_time desc) a
 Where rownum <= 10

4个回答

type这个变量在哪里定义的?

(select id from sys_business_type b where b.type = :type)
换成具体的值,不用type变量看看是否报错。

qq_38081404
IT界98新星 一样的 我开始复制错代码了 我把占位符删了也是说01008
大约一年之前 回复

那个代码 :type用具体的值 删掉也是报同一个错

今天碰到一个很普通的问题:ORA-01008:并非所有的变量都已绑定,看着错误的提示,总以为是自己的变量和值不是对称的,检查了很多遍,后来,突然想起可能是因为变量的值是null造成的,而并非值和和变量没有一一对应。经检查发现,确实有一个值是null,不是空格,然后把值改成空格,就好了。

分析执行计划的话,:换成&试试,应该就可以过去了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ORACLE 并非所有变量都已绑定
菜鸟提问rnvariable job_te number;rnbegin rn:job_te := 1; rnend; rnrn执行总数报并非所有变量都已绑定,这是什么情况,我这个操作不就是为了给变量绑定值吗?
ORA-01008: 并非所有变量都已绑定
[img=https://img-bbs.csdn.net/upload/201708/11/1502439925_534824.png][/img]
PLSQL并非所有变量都已绑定
select * from table1 where id =:iirn像这种查询,在PLSQL中,就会提示:ORA-01008:并非所有变量都已绑定.rn问:在PLSQL中是否可以设置,遇到这种情况时,就会弹出让自己赋值的呢?rn就是遇到冒号,就会弹出框来,然后可以赋值的。
‘ORA-01008: 并非所有变量都已绑定 ’
--存储过程rncreate or replace procedure test1(rcursor out sys_refcursor) asrnbeginrn open rcursor forrn select t.id, t.value from ceshi t;rnend;rn/rnrn--调用rn declare rn type cur is ref cursor;rn begin rn test1(:cur);rn end;rnrn说明:存储过程没有问题,调用时提示:‘ORA-01008: 并非所有变量都已绑定 ’rn请问大侠这是怎么回事呢,我刚学存储的。
请教:ORA-010008:并非所有变量都已绑定
在表里建立了一个Update触发器,执行时出现如下提示:rn[img=https://img-bbs.csdn.net/upload/201607/07/1467880141_51340.png][/img]rn代码如下:rn[code=sql]CREATE OR REPLACE TRIGGER T_UPT_DUTYDETAILrnAFTER UPDATE rnON ZZITC_ARRANGEDCLASS rnFOR EACH ROWrnDECLARE rn v_month VARCHAR2(2);rn v_year VARCHAR2(4);rn v_loop_start NUMBER(2,0) := 1;rn v_loop_end NUMBER(2,0);rn v_sql VARCHAR2(2000);rn v_checkDate Date;rn --v_yymm varchar2(6);rn --v_empid varchar2(6);rn --v_day1 varchar2(2);rnBEGINrn --删除被Insert或者Update的数据rn Delete From ZZITC_DUTYDETAILrn Where YYMM = :OLD.YYMMrn And EMPID = :OLD.EMPIDrn ;rn --根据被修改的行的年月,判断被修改月份是何种性质rn v_year := SUBSTR(:NEW.YYMM, 1, 4);rn v_month := SUBSTR(:NEW.YYMM, 5, 2);rn --rn IF v_month='02' Thenrn --是2月份,则判断是否为闰年rn IF MOD(TO_NUMBER(v_year),4) = 0 Thenrn --闰年2月rn v_loop_end := 29;rn ElsIF MOD(TO_NUMBER(v_year),4) <> 0 Thenrn --非闰年2月rn v_loop_end := 29;rn End IF;rn ELSIF v_month IN ('01','03','05','07','08','10','12') Then rn --大月rn v_loop_end := 31;rn ELSIF v_month IN ('04','06','09','11') Thenrn --小月rn v_loop_end := 30; rn END IF;rn --已根据月份判断出大小月,则循环生成每天的数值rn <>rn LOOPrn v_checkDate := TO_DATE(to_char(substr(:NEW.YYMM,1,4)||'-'||substr(:NEW.YYMM,5,6)||'-'||TO_CHAR(v_loop_start,'00')),'yyyy-mm-dd');rn v_sql := 'INSERT INTO ZZITC_DUTYDETAIL(YYMM,EMPID,DUTYDATE,DUTYFLAG) VALUES(:NEW.YYMM,:NEW.EMPID,to_date('||''''||v_checkDate||''''||','||''''||'yyyy-mm-dd'||''''||'),:NEW.Day'||v_loop_start||')';rn DBMS_OUTPUT.PUT_LINE(v_sql);rn --v_yymm := :new.yymm;rn --v_empid := :new.empid;rn --v_day1 := :new.day1;rn --dbms_output.put_line(v_yymm);rn --dbms_output.put_line(v_empid);rn --dbms_output.put_line(v_day1);rn EXECUTE IMMEDIATE v_sql;rn --execute immediate 'INSERT INTO ZZITC_DUTYDETAIL(YYMM,EMPID,DUTYDATE,DUTYFLAG) VALUES(:NEW.YYMM,:NEW.EMPID,to_date('||''''||v_checkDate||''''||','||''''||'yyyy-mm-dd'||''''||'),:NEW.Day'||v_loop_start||')';rn v_loop_start := v_loop_start+1;rn EXIT LOOP_GENDUTYDETAIL WHEN v_loop_start > v_loop_end;rn END LOOP;rnEND;rn[/code]rn执行结果到了EXECUTE IMMEDIATE v_sql;这句时就提示未绑定变量。但是我在PL/SQL里,通过Output输出了v_sql,结果如下:rn[code=sql]INSERT INTO ZZITC_DUTYDETAIL(YYMM,EMPID,DUTYDATE,DUTYFLAG) VALUES(:NEW.YYMM,:NEW.EMPID,to_date('2016.07.01','yyyy-mm-dd'),:NEW.Day1)[/code]rn一直没找到问题到底在哪里,还请各位指点迷津。
: 数据集ds1的 sql异常:ORA-01008: 并非所有变量都已绑定
select ACCT_MONTH,rnarea_desc,rnTELE_TYPE,rnBRAND,rnsum(ONNET_USERS)ONNET_USERS,rnsum(ACCT_USERS)ACCT_USERS,rnsum(CALL_USERS) CALL_USERS,rnsum(DEV_USERS)DEV_USERS,rnsum(INC_ONNET_USERS)INC_ONNET_USERS,rnsum(INC_ACCT_USERS)INC_ACCT_USERS,rnsum(OUTNET_USERS1)OUTNET_USERS1,rnsum(OUTNET_USERS2)OUTNET_USERS2,rnsum(OUTNET_USERS3)OUTNET_USERS3,rnsum(DEV_OUTNET_USERS)DEV_OUTNET_USERS,rnSUM(INC_ACCT_USERS)/SUM(decode(DEV_USERS,0,1)) DEV_NNP,rnsum(OUTNET_USERS2)/sum(decode(ONNET_USERS,0,1)) outnet_nnprn from REPORT.REPORT_BRAND_DEV a,rnDIM.DIM_AREA_NO brnWHERE a.area_no=b.area_nornand acct_month=? rn group by ACCT_MONTH,rnarea_desc,rnTELE_TYPE, rnBRAND
select时报并非所有变量都已绑定?????
select count(*) from mailsendrecord msr where 1=1 and msr.mainid = ? and msr.result != ?rnrnString sql = buildSQL(cmd, 0, 0);rnNumber num = jt.queryForObject(sql, Integer.class);报错rnreturn (num == null?0:num.intValue());rnrnsql语句在 sql developer中并不报错,好用rn请大神指教
asp.net出现‘并非所有变量都已绑定'
今天遇到这个问题,数据是Oracle,用动软生成的三层,提交一个表单老是出现‘并非所有变量都已绑定',跪求各位老大指教啊
并非所有变量都已绑定,是怎么回事?
C#连接Oracle总是报错。rnoleDbCommand.CommandText = " select * from t where a= :hhhh";rnoleDbCommand.Parameters.Add("hhhh",OleDbType.Numeric);rnoleDbCommand.Parameters[0].Value = 2;rnoleDbConnection.Open();rnint i = oleDbCommand.ExecuteNonQuery();rnoleDbConnection.Close();rnrn提示:ORA-01008: 并非所有变量都已绑定
ORA-01008:&nbsp;并非所有变量都已绑定
java.sql.SQLException: ORA-01008: 并非所有变量都已绑定 此异常为sql异常,我遇到的时候看java代码如下 public void savegdzcysxx(Gdzcxx gdzcxx) {   String sql="insert into gdzcxx (id,zcmc,ggxh) values(SEQ_GDZC_ID.nextVAL,?,?)";   Mys
job - ORA-01008 并非所有变量都已绑定
    # 命令行新建 job 错误: ORA-01008 并非所有变量都已绑定 。  1、改正前代码: DECLARE job NUMBER; begin           sys.dbms_job.submit(job =&amp;gt; :job, what =&amp;gt; 'P_AUTO_FETCH_RECORDS;', next_date =&amp;gt; to_...
求助:并非所有的变量都已绑定
[code=C#] public int SelectByCode( DateTime reg_date, String doctor_code)rn rn string commandText = "SELECT COUNT(*) FROM SEHR_ORG_REGISTER_SECTION WHERE REG_DATE = :REG_DATE AND DOCTOR_CODE = :DOCTOR_CODE";rn OracleConnection con = new OracleConnection(this.connectionString);rn OracleCommand cmd = new OracleCommand(commandText, con);rn con.Open();rn rn OracleParameter[] commandParameters = new OracleParameter[2];rn rn commandParameters[0] = new OracleParameter(":REG_DATE", reg_date);rnrn commandParameters[1] = new OracleParameter(":DOCTOR_CODE", doctor_code);rn OracleDataReader dr;rn DataSet ds = new DataSet();rn int strCount;rn tryrn rn dr = OracleHelper.ExecuteReader(this.connectionString, CommandType.Text, commandText, commandParameters); rn// int count = Convert.ToInt32(cmd.ExecuteScalar());rn OracleDataAdapter da = new OracleDataAdapter(commandText,con);rn da.Fill(ds, "SEHR_ORG_REGISTER_SECTION");rn strCount = Convert.ToInt32(ds.Tables["SEHR_ORG_REGISTER_SECTION"].Rows.Count); rn rn catch (Exception ex)rn rn throw ex;rn [/code]
ORA-01008: 并非所有变量都已绑定,帮忙看看哪错了
[code=C#]rn /// rn /// oracle数据库操作rn /// rn /// rn /// rn public int oracleExecuteNonQuery(string sql)rn rn using (OracleConnection conn = new OracleConnection(ConnString))rn rn conn.Open();rn using (OracleCommand cmd = conn.CreateCommand())rn rn cmd.CommandText = sql;rn int i = cmd.ExecuteNonQuery();rn return i;rn rn rn rnrn /// rn /// 增加数据rn /// rn /// rn public void Add(string tableName)rn rn string sql = "select * from " + tableName;rn DataSet ds = db.sqlTableShow(sql);rn for (int i = 0; i < ds.Tables[0].Rows.Count; i++)rn rn model.IDVOLUME = Int32.Parse(ds.Tables[0].Rows[i]["IDVolume"].ToString());rn model.IDARCHIVE = long.Parse(ds.Tables[0].Rows[i]["IDArchive"].ToString());rn model.ARCHIVEID = ds.Tables[0].Rows[i]["ArchiveID"].ToString();rn model.DUTYMAN = ds.Tables[0].Rows[i]["DutyMan"].ToString();rn if (ds.Tables[0].Rows[i]["Title"].ToString().Contains("'"))rn rn model.TITLE = ds.Tables[0].Rows[i]["Title"].ToString().Replace("'", "吋");rn rn elsern rn model.TITLE = ds.Tables[0].Rows[i]["Title"].ToString();rn rn model.GOTTIME = Convert.ToDateTime((Convert.ToDateTime(ds.Tables[0].Rows[i]["GotTime"])).ToString("yyyy-MM-dd"));rn model.PAGES = ds.Tables[0].Rows[i]["Pages"].ToString();rn model.REMARK = ds.Tables[0].Rows[i]["Remark"].ToString();rn model.JUANXUHAO = ds.Tables[0].Rows[i]["JuanXuHao"].ToString();rn if (ds.Tables[0].Rows[i]["TitleFormat"].ToString().Contains("'"))rn rn model.TITLEFORMAT = ds.Tables[0].Rows[i]["TitleFormat"].ToString().Replace("'", "吋");rn rn elsern rn model.TITLEFORMAT = ds.Tables[0].Rows[i]["TitleFormat"].ToString();rn rn model.GOTTIMESPECIAL = ds.Tables[0].Rows[i]["GotTimeSpecial"].ToString();rn StringBuilder strSql = new StringBuilder();rn strSql.Append("insert into AMARCHIVES(");rn strSql.Append("IDVOLUME,TITLEFORMAT,GOTTIMESPECIAL,IDARCHIVE,ARCHIVEID,DUTYMAN,TITLE,GOTTIME,PAGES,REMARK,JUANXUHAO");rn strSql.Append(") values (");rn strSql.Append(":IDVOLUME,:TITLEFORMAT,:GOTTIMESPECIAL,:IDARCHIVE,:ARCHIVEID,:DUTYMAN,:TITLE,:GOTTIME,:PAGES,:REMARK,:JUANXUHAO");rn strSql.Append(") ");rnrn OracleParameter[] parameters = rn new OracleParameter(":IDVOLUME", OracleType.Number,10) , rn new OracleParameter(":TITLEFORMAT", OracleType.NVarChar) , rn new OracleParameter(":GOTTIMESPECIAL", OracleType.NVarChar) , rn new OracleParameter(":IDARCHIVE", OracleType.Number,19) , rn new OracleParameter(":ARCHIVEID", OracleType.NVarChar) , rn new OracleParameter(":DUTYMAN", OracleType.NVarChar) , rn new OracleParameter(":TITLE", OracleType.NVarChar) , rn new OracleParameter(":GOTTIME", OracleType.DateTime) , rn new OracleParameter(":PAGES", OracleType.NVarChar) , rn new OracleParameter(":REMARK", OracleType.NVarChar) , rn new OracleParameter(":JUANXUHAO", OracleType.NVarChar) rn ;rnrn parameters[0].Value = model.IDVOLUME;rn parameters[1].Value = model.TITLEFORMAT;rn parameters[2].Value = model.GOTTIMESPECIAL;rn parameters[3].Value = model.IDARCHIVE;rn parameters[4].Value = model.ARCHIVEID;rn parameters[5].Value = model.DUTYMAN;rn parameters[6].Value = model.TITLE;rn parameters[7].Value = model.GOTTIME;rn parameters[8].Value = model.PAGES;rn parameters[9].Value = model.REMARK;rn parameters[10].Value = model.JUANXUHAO;rn db.oracleExecuteNonQuery(strSql.ToString());rn rn rn[/code]rnrn提示ORA-01008: 并非所有变量都已绑定
JDBC错误:java.sql.SQLException: ORA-01008: 并非所有变量都已绑定
public int addCourseTime(CourseTimeBean ctb){ int csh_no=ctb.getCsh_no(); int csh_id=ctb.getC_id(); String csh_start_time=ctb.getCsh_start_time(); String csh_due_time=...
nested exception is java.sql.SQLException: ORA-01008: 并非所有变量都已绑定
[code=java]rn/**rn * WEBOPAC_读者空间_借阅管理_查看借阅信息_当前借阅信息rn * @param readerIdrn * @param lendStatusrn * @returnrn */rn public Page queryReaderLendRecordForTwo(Long readerId,rn Integer lendStatus,Pageable pageable) rn StringBuilder sql=new StringBuilder();rn MapSqlParameterSource paramSource = new MapSqlParameterSource();rn StringBuilder countSql=new StringBuilder();rn sql.append("select t.id,t.collection_id,c.status from READER_LEND_RECORD t , collection c where c.id = t.collection_id and t.reader_id =:readerId");rn paramSource.addValue("readerId", readerId);rn sql.append(" and t.status =:lendStatus");rn paramSource.addValue("lendStatus", lendStatus);rn System.out.println("WEBOPAC_读者空间_借阅管理_查看借阅信息_当前借阅信息 sql:" + sql);rn countSql.append("select count(*) from ("+ sql +")");rn Page page = JdbcPaginationHelper.queryForPage(namedJdbcTemplate, pageable, sql.toString(), countSql.toString(), new RowMapper()rn public WebOpacQueryVo mapRow(ResultSet rs, int rowNum)rn throws SQLException rn WebOpacQueryVo woqv = new WebOpacQueryVo();rn woqv.setCollection(collectionDao.findOne(rs.getLong("collection_id")));rn woqv.setCollectionStatus(sysDicDao.findByTypeAndKey(Constant.COLLECTION_STATUS, rs.getInt("status")));rn woqv.setReaderLendRecord(readerLendRecordDao.findOne(rs.getLong("id")));rn return woqv;rn );rn return page;rn rn[/code]rnrn打印出的sql rnrnWEBOPAC_读者空间_借阅管理_查看借阅信息_当前借阅信息 sql:rnrn[code=sql]rnselect t.id,t.collection_id,c.status from READER_LEND_RECORD t , collection c where c.id = t.collection_id and t.reader_id =:readerId and t.status =:lendStatusrn[/code]rnreaderId=921 和 lendStatus=2 debug的时候都不为空 rnrn看了半天看不出什么问题?rn难道整个下午要葬送在这个问题上?rn
ORA-01008 并非所有变量都已关联 ????
const char szSql[]= "select workertype from v_zj_workertype where coding = :PARAM_CODING" ;rnif(0 == m_OParameter.GetCount())rnrn //第二个参数nNum是int型,确定不是空值rn m_OPNewzjZjNameLeft.Add("PARAM_CODING",nNum,OPARAMETER_INVAR,OTYPE_NUMBER) ; rn if(OFAILURE == m_RowSet.Open(m_Db,szSql))rn rn strMsg.Format("%s",m_RowSet.GetErrorText()) ; //strMsg = "ORA-01008 并非所有变量都已关联"rn return FALSE ;rn rnrnelsernrn ……rnrn这段代码执行到m_RowSet.Open(m_Db,szSql))老返回OFAILURErn提示"ORA-01008 并非所有变量都已关联"rn请教各位,问题出在哪里?谢谢
java程序出现问题:java.sql.SQLException: ORA-01008: 并非所有变量都已绑定
异常提示是 并非所有变量都已绑定,实际上从sql语句上看是没有问题,直接使用在数据库也是有效的,那么他为什么会报ORA-01008: 并非所有变量都已绑定,这个这个问题一般出现在sql语句,因为程序写的sql语句可能出现所查询没有的字段,而此处sql语句没有错误,出问题的地方是preparedStatemnt.executeUpdate(sql)这条语句,这是使用PreparedStateme...
ORA-01008: 并非所有变量都已关联”
大家帮忙看看:rn源代码:rn StringBuilder strSql = new StringBuilder();rn strSql.Append("insert into ACCOUNTS_USERS(");rn strSql.Append("USERID,USERNAME,PASSWORD,TRUENAME,SEX,PHONE,EMAIL,EMPLOYEEID,COMPANYID,ACTIVITY,USERTYPE,STYLE)");rn strSql.Append(" values (");rn strSql.Append(":USERID,:USERNAME,:PASSWORD,:TRUENAME,:SEX,:PHONE,:EMAIL,:EMPLOYEEID,:COMPANYID,:ACTIVITY,:USERTYPE,:STYLE)");rn OracleParameter[] parameters = rn new OracleParameter("USERID", OracleType.Number,4),rn new OracleParameter("USERNAME", OracleType.VarChar,16),rn new OracleParameter("PASSWORD", OracleType.Blob,model.PASSWORD.Length),rn new OracleParameter("TRUENAME", OracleType.VarChar,16),rn new OracleParameter("SEX", OracleType.VarChar,2),rn new OracleParameter("PHONE", OracleType.VarChar,20),rn new OracleParameter("EMAIL", OracleType.VarChar,50),rn new OracleParameter("EMPLOYEEID", OracleType.Number,4),rn new OracleParameter("COMPANYID", OracleType.VarChar,10),rn new OracleParameter("ACTIVITY", OracleType.Number,4),rn new OracleParameter("USERTYPE", OracleType.VarChar,2),rn new OracleParameter("STYLE", OracleType.Number,4);rn parameters[0].Value = model.USERID;rn parameters[1].Value = model.USERNAME;rn parameters[2].Value = model.PASSWORD;rn parameters[3].Value = model.TRUENAME;rn parameters[4].Value = model.SEX;rn parameters[5].Value = model.PHONE;rn parameters[6].Value = model.EMAIL;rn parameters[7].Value = model.EMPLOYEEID;rn parameters[8].Value = model.COMPANYID;rn parameters[9].Value = model.ACTIVITY;rn parameters[10].Value = model.USERTYPE;rn parameters[11].Value = model.STYLE;rnrn报错:并非所有变量都已关联 rnpassword 为byte[]类型
请问并非所有变量都已绑定怎么解决
这是我的代码,运行时出现并非所有变量都已绑定rndw_2.SetTransObject(sqlca)rnstring cs_cssrnrnstring abcrndw_2.accepttext()rnabc= dw_4.getitemstring(1,"names")rnmessagebox("",abc)rncs_css = dw_2.getsqlselect()rncs_css += " where z_goodsname = :abc"rnrndw_2.setsqlselect(cs_css)rndw_2.Retrieve()
建job时报错 ORA-01008 并非所有变量都已绑定
[code=SQL]rnbeginrn sys.dbms_job.submit(job => :jobno,rn what => 'BACKUPTABLE(30);',rn next_date => to_date(to_char(sysdate+1,'yyyy-mm-dd ')||'01:00:00', 'yyyy-mm-dd hh24:mi:ss'),rn interval => 'sysdate+1');rn commit;rnend;rn/rn[/code]rnrn代码很简单,也知道有问题,应该是如下形式,但是我的问题是,上面的代码有的时候好使,有的时候报错(ORA-01008 并非所有变量都已绑定):rn[code=SQL]rndeclarernjobno number;rnbeginrn sys.dbms_job.submit(job => jobno,rn what => 'BACKUPTABLE(30);',rn next_date => to_date(to_char(sysdate+1,'yyyy-mm-dd ')||'01:00:00', 'yyyy-mm-dd hh24:mi:ss'),rn interval => 'sysdate+1');rn commit;rnend;rn/rn[/code]
java ORA-01008: 并非所有变量都已绑定避坑
//数据库增加数据的函数 public boolean add(Credit c) { String sql = " insert into credit(id,name,pwd,Money)" +"values(?,?,?,?) "; //要插入的对象中的数据拿到object数组中 Object o[] = {c.getId(),c.getName(),c.getPwd()...
ORA-01008: 并非所有变量都已关联
各位大虾rn 修改的时候一直出现这个问题,帮忙看下~~~~rn 代码如下rnrnrnsql.append(" update TB_INF_MODELTESTINFO set C_EMPOID=?"+",")rn .append(" C_OPERATETIME=?"+",")rn .append(" C_OPERATOR=?"+",")rn .append(" C_DATE=?"+",")rn .append(" C_SUMMARIZE=?"+",")rn .append(" C_MARK=?"+",")rn .append(" C_UNITIDEA=?"+",")rn .append(" C_COMMITTEEIDEA=?"+",")rn .append(" C_GROUPIDEA=?"+",")rn .append(" C_MODEDUTYID=?")rn .append(rn " where C_OID_MODELTESTINFO=?");rn try rn java.sql.PreparedStatement state = this.getSession().connection().prepareStatement(sql.toString());rn state.setLong(1, vo.getEmpID());rn state.setTimestamp(2, new java.sql.Timestamp(curDate.getTime()));rn state.setLong(3, curEmpID);rn state.setTimestamp(4, new java.sql.Timestamp(vo.getDate().getTime()));rn state.setString(5, vo.getSummarize());rn state.setInt(6, vo.getMark());rn state.setString(7, vo.getUnitIdea().getCode());rn state.setString(8, vo.getCommIdea().getCode());rn state.setString(9, vo.getGroupIdea());rn state.setLong(10, vo.getModelDutyID());rn state.setLong(11, vo.getOid());rn rn state.executeUpdate(sql.toString());
ORA-01008: 并非所有变量都已关联(急……)
不知道错在哪里?请高手帮帮忙!谢了!rn数据库表结构:rncreate table TblRPTFILErn(RPTFILENO number not null,rn RPTSHOWNAME varchar2(100) not null,rn RPTFILENAME varchar2(50) not null,rn RPTFILEBEGINYEAR date not null,rn RPTFILEENDYEAR date not null,rn constraint TblRPTFILE_PK primary key (rptfileno));rnrn代码:rn string sqlStr = "insert into tblRPTFILE values(RPTFILESeq.nextval,:RPTShowName,:RPTFileName,:StartDate,:EndDate)";rn OracleCommand cmd = DB.GetCommand(sqlStr);rn cmd.Parameters.Add(":RPTShowName",OracleType.VarChar,100).Value=this.reportName;rn cmd.Parameters.Add(":RPTFileName",OracleType.VarChar,50).Value=this.filePath;rn cmd.Parameters.Add(":StartDate",OracleType.DateTime).Value=OracleDateTime.Parse(this.startDate.ToString());rn cmd.Parameters.Add(":EndDate",OracleType.DateTime).Value=OracleDateTime.Parse(this.endDate.ToString());rn tryrn rn cmd.Connection.Open();rn cmd.ExecuteNonQuery(); //到这就出错了rn cmd.Connection.Close();rn
ORA-01008: 并非所有变量都已关联 --的问题
ORA-01008: 并非所有变量都已关联 rn下面是代码,检查不出,哪个变量没赋值关联啊。小弟新手,谢谢指教。 rnrnrn[code=C#]rnprotected void btChangeProc_Click(object sender, EventArgs e)rn rnrn string CaseId = Request["CaseId"];rn string AptdDept = ddlDeptId.SelectedValue.ToString();rn string AptdUser = ddlProcUser.SelectedValue.ToString();rnrnrn OracleConnection cn = new OracleConnection(OracleHelper.ConnectionStringLocalTransaction); rn OracleCommand cmd = new OracleCommand("UPDATE O_C_CaseRecord set APTDDEPT= :AptdDept, APTDUSER = :AptdUser, STATE = '待处理' WHERE CASEID= :CaseId ",cn); rnrn cn.Open(); rn rn //执行命令rn int val = cmd.ExecuteNonQuery();rn cmd.Parameters.Clear();rn //判断是否修改成功rn if (val > 0)rn btChangeProc.Text = "移交成功";rn elsern btChangeProc.Text = "移交失败";rnrn cn.Close(); rn rn rn rn[/code]rnrnrnrnrn报错: rn+ $exception "ORA-01008: 并非所有变量都已关联\n" System.Exception System.Data.OracleClient.OracleException rn+ this ASP.memberpages_operm_case_chgcaseproc_aspx MemberPages_OperM_Case_ChgCaseProc ASP.memberpages_operm_case_chgcaseproc_aspx rn+ sender Text = "确认移交" object System.Web.UI.WebControls.Button rn+ e System.EventArgs System.EventArgs rnCaseId " 2008121110" string rnAptdDept "1" string rnAptdUser "jiangxy" string rn+ cn System.Data.OracleClient.OracleConnection System.Data.OracleClient.OracleConnection rn- cmd System.Data.OracleClient.OracleCommand System.Data.OracleClient.OracleCommand rn+ base System.Data.OracleClient.OracleCommand System.Data.Common.DbCommand System.Data.OracleClient.OracleCommand rnCommandText "UPDATE O_C_CaseRecord set APTDDEPT= :AptdDept, APTDUSER = :AptdUser, STATE = '待处理' WHERE CASEID= :CaseId " string rnCommandTimeout 0 int rnCommandType Text System.Data.CommandType rn+ Connection System.Data.OracleClient.OracleConnection System.Data.OracleClient.OracleConnection rnDesignTimeVisible true bool rn+ Parameters System.Data.OracleClient.OracleParameterCollection System.Data.OracleClient.OracleParameterCollection rn+ Transaction null System.Data.OracleClient.OracleTransaction rnUpdatedRowSource Both System.Data.UpdateRowSource rn+ 静态成员 rn+ 非公共成员 rnval 0 int rn
创建INSTEAD OF触发器报错ORA-01008并非所有变量都已绑定
[code=sql]CREATE TABLE GY(rncno VARCHAR(5),rnsupno VARCHAR(5),rnprono VARCHAR(5),rnFOREIGN KEY(cno)REFERENCES C(cno),rnFOREIGN KEY(supno)REFERENCES supplier(supno),rnFOREIGN KEY(prono)REFERENCES project(prono)rn);[/code]rnrn[code=sql]CREATE TABLE supplier(rnsupno VARCHAR(5) PRIMARY KEY,rnsupname VARCHAR(12),rnaddress VARCHAR(30), rntelephone VARCHAR(20),rncno VARCHAR(5),rngyl VARCHAR(30),rnFOREIGN KEY(cno)REFERENCES C(cno)rn);[/code]rnrn[code=sql]Create VIEW gylrnASrnSELECT supplier.cno,supplier.supno,gyl,GY.prono FROM supplier Left Outer Join GY ON supplier.supno=GY.supno;rn[/code]rnrn[code=sql]create or replace trigger TR_I_gyl INSTEAD OFrnINSERT ON gyl FOR EACH ROW DECLARE V_count NUMBER;rnBEGINrnSELECT count(*) INTO V_vount FROM supplier WHERE supno=:new.supno;rnIF V_count=0 THENrn INSERT INTO supplier(supno,supname,address,telephone,gyl)VALUES(:new.supno,:new.supname,:new.address,:new.telephone,:new.gyl);rn END IF;rn SELECT count(*) INTO V_count FROM GY WHERE cno=:new.cno;rn IF V_count=0 THENrn INSERT INTO GY(cno,supno,prono)VALUES(:new.cno,:new.supno,:new.prono);rn END IF;rn END;[/code]rnrn我在最后创建触发器出现的问题,我要创建一个可以直接对视图操作的INSTEAD OF触发器,麻烦帮我解决一下。
更新数据时报错,ORA-01008: 并非所有变量都已绑定
错误信息:rnjava.sql.SQLException: ORA-01008: 并非所有变量都已绑定rn Query: update users_xyy set password=?,truename=?,phone=?,sex=?,email=? where username=?321 Parameters: [321, 321fgh, 312312, 男, 123123@163.com]rnrn问号是5个 我也传了5个参数 但是为什么报这个错误呢?rn我用的是dbuutils,rn这是我更新时调用的方法:rn public boolean update(UserInf ui) rn DBUtils dbOp = new DBUtils();rn String sql = "update users_xyy set password=?,truename=?,phone=?,sex=?,email=? where username=?" + ui.getUserName();rnrn String[] params = ui.getPassWord(),ui.getTrueName(),rn ui.getPhone(),ui.getSex(),ui.getEmail()rn ;rn if (dbOp.update(sql, params)) rn return true;rnrn else rn return false;rn rn
.NET使用ORACLE,ORA-01008: 并非所有变量都已关联
rn.NET连接ORACLE,执行SQL命令时,报这个错误。rnrn同样的代码,在MYSQL是正常的。rnrn郁闷。弄了N久,都没找到解决方法。
关于错误“并非所有变量都已绑定”,上SQL在线求指正
declarern v_clob clob := '测试数据1111111111111';rn beginrn insert into T04_Law (LAWID, LAWTITLE, LAWBELONG, LAWCONTENT, DELFLAG, CREATEUSERID, CREATEDATE, UPDATEUSERID, UPDATEDATE, DELUSERID, DELDATE)rn valuesrn ('1c2647772e374344b7c374ea850edb6b',rn '测试数据1',rn 'e5e40b7c9bdc49deb142e6f1f00a040f',rn :clob,rn 0,rn '024',rn to_date('2013-08-09 13:26:30', 'yyyy-MM-dd hh24:mi:ss'),rn '',rn '',rn '',rn '');rn end;rn 会有ORA-01008:并非所有变量都已绑定的提示,该如何解决?rn
Oracle 之PL/SQL 变量与常量
一:常量与变量    数据类型:        常用标准类型:CHAR(CHARATER,NCHAR),VARCHAR2,NUMBER(P,S),DATE,BOOLEAN等。        属性类型:%TYPE 与 %ROWTYPE                        %TYPE:可以用来定义数据变量的类型与已定义的数据变量(表中的列)一致。                       ...
oracle 或sql server 语句遇到并非所有变量都已帮定的问题
今天碰到一个很普通的问题:ORA-01008:并非所有的变量都已绑定,看着错误的提示,总以为是自己的变量和值不是对称的,检查了很多遍,后来,突然想起可能是因为变量的值是null造成的,而并非值和和变量没有一一对应。经检查发现,确实有一个值是null,不是空格,然后把值改成空格,就好了。    希望解决方法可以帮助碰到同样问题的朋友们!
创建job时报错,并非所有的变量都已绑定
我的job语句如下:rn[code=sql]rnBEGINrn SYS.dbms_job.submit(job => :job,rn what => 'sp_update_ycz;',rn next_date => SYSDATE,rn INTERVAL => 'trunc(sysdate) + 20/24');rn COMMIT;rnEND;[/code]rn执行的时候就会报错[img=https://img-bbs.csdn.net/upload/201502/02/1422856562_409615.png][/img]rn但是以前创建物化视图的job就可以正常执行,语句如下:rn[code=sql]beginrn sys.dbms_job.submit(job => :job,rn what => 'dbms_refresh.refresh(''"U_MOBILE_DB"."MV_BASE_FENXI"'');',rn next_date => to_date('02-02-2015 23:00:00', 'dd-mm-yyyy hh24:mi:ss'),rn interval => 'trunc(SYSDATE + 1) - 1/24');rn commit;rnend;[/code]rn原因为何呢?
请教:如何删除oracle定时任务,操作时报“并非所有变量都已绑定”
本人按照例子做了个练习,如下:rn-----------------------------------------rn1.创建一个表,为了能清楚看到定时器的运行情况我们创建一个带有日期字段的表 rn Sql代码 rncreate table job_table(run_time date); rnrn2.创建存储过程 rn Sql代码 rncreate or replace procedure job_proc is rnbegin rn insert into job_table (run_time) values (sysdate); rn commit; rnend; rnrn3.创建job,并且指定为一分钟执行一次 rn Sql代码 rndeclare rn job number; rnbegin rn dbms_job.submit(job, 'job_proc;', sysdate, 'TRUNC(sysdate,''mi'') + 1/(24*60)'); rnend; rn rn-----------------------------------------rnrn执行没有问题,表中可以定时存储数据;rn现在我想删除这个任务,先查出job号:rn select job,broken,what,interval,t.* from user_jobs t;rn查到这个任务信息为:rn JOB BROKEN WHAT INTERVALrnrn 46 N job_proc; TRUNC(sysdate,'mi') + 1/(24*60)rnrn,然后删除这个任务,执行:rn begin rn dbms_job.remove(:46); rn end; rnrn报出“[color=#FF0000]ORA-01008: 并非所有变量都已绑定[/color]”。rn我看了dbms_job.remove语法,说已经执行的任务不能删除,可能是这个原因;rnrn那么怎么才能删除这个任务呢?请大神帮忙!谢谢!
PL/SQL SQL ORACLE
PL/SQL SQL ORACLE VERY GOOD ENGLISH
oracle sql and pl/sql
oracle sql and pl/sql
向oracle中插入数据时提示“ORA-01008: 并非所有变量都已绑定”
要插入的表结构是:除了主键外,其他属性均可为空。[img=http://pic002.cnblogs.com/images/2011/294624/2011081511505173.png][/img]rnrn插入方法:rnrnpublic bool Insert(MMember mMember)rn rn string sqlText = "Insert Into MemberS (MemberID,MemberName,Sex,company,Mobile,Phone,Fax,Address,MemberType,PayType,BankCard,BankName,Memo,BankTime)"rn + " Values(:MemberID,:MemberName,:Sex,:Company,:Mobile,:Phone,:Fax,:Address,:MemberType,:PayType,:BankCard,:BankName,:Memo,:BankTime)";rn OracleParameter[] parms = new OracleParameter[] rn rn new OracleParameter("MemberID", OracleType.VarChar),rn new OracleParameter("MemberName", OracleType.NVarChar),rn new OracleParameter("Sex", OracleType.NVarChar),rn new OracleParameter("Company", OracleType.NVarChar),rn new OracleParameter("Mobile", OracleType.VarChar),rn new OracleParameter("Phone", OracleType.VarChar),rn new OracleParameter("Fax", OracleType.VarChar),rn new OracleParameter("Address", OracleType.NVarChar), rn new OracleParameter("MemberType", OracleType.NVarChar),rn new OracleParameter("PayType", OracleType.NVarChar),rn new OracleParameter("BankCard", OracleType.VarChar),rn new OracleParameter("BankName", OracleType.NVarChar),rn new OracleParameter("Memo", OracleType.NVarChar),rn new OracleParameter("BankTime", OracleType.Timestamp)rn ;rn parms[0].Value = mMember.MemberID;rn parms[1].Value = mMember.MemberName;rn parms[2].Value = mMember.Sex;rn parms[3].Value = mMember.Company;rn parms[4].Value = mMember.Mobile;rn parms[5].Value = mMember.Phone;rn parms[6].Value = mMember.Fax;rn parms[7].Value = mMember.Address;rn parms[8].Value = mMember.MemberType;rn parms[9].Value = mMember.PayType;rn parms[10].Value = mMember.BankCard;rn parms[11].Value = mMember.BankName;rn parms[12].Value = mMember.Memo;rn if (string.IsNullOrEmpty(mMember.BankCard))rn rn parms[13].Value = null;rn rn elsern rn parms[13].Value = DateTime.Now;rn rnrn CacheUtility.RemoveCache(0, "Members");rn int rowsAffected = 0;rn tryrn rn rowsAffected = OracleHelper.ExecuteNonQuery(OracleHelper.Connection_String, CommandType.Text, sqlText, parms);//执行语句rn rn catch (Exception ex)rn rn return false;rn rn return rowsAffected > 0;rn rnrn调用的时候只对 MemberID = memId,rn MemberName=memName,rn Phone=memPhone,rn Mobile=memMobile,rn MDate=DateTime.Now这五个属性进行了赋值,其他的没赋值。rnrn按说其他属性允许为空的,插入的时候为什么还提示“ORA-01008: 并非所有变量都已绑定”??rnrn
ExecuteNonQuery();并非所有的字段都已绑定
string str = "Data Source=changsha; User ID=changsha; Password=changsha;";rn OracleConnection conn = new OracleConnection(str);rn string strSql = "insert into wf_caselist(CASEID,CASETYPE) values(:CASEID,:CASETYPE)";rn OracleCommand myCommand = new OracleCommand(strSql);rn myCommand.Connection = conn;rn conn.Open();rn myCommand.ExecuteNonQuery();rn conn.Close();rn各位大侠,麻烦看看这段代码,我一执行,老是在myCommand.ExecuteNonQuery();报出“ora-01008,并非所有的字段都已绑定”的错误。rn我不知道是程序写错了还是oracle的问题。rn请指教怎么解决。
ORA-01008:并非所有变量都以绑定、、、求解!!!
存储过程:rn[code=SQL]rncreate or replace procedure auto_unsealrnasrncursor c_seal is select sealend,unsealauditing from vary_seal_detail;rnv_emp c_seal%rowtype;rnbeginrn for v_emp in c_seal looprn if to_char(sysdate,'yyyy-MM-dd')=v_emp.sealend then rn beginrn update vary_seal_detail set vary_seal_detail.unsealauditing='1';rn end;rn end if;rn end loop;rnend;rn[/code]rnrnjob定时器:rn[code=SQL]rnbeginrn dbms_job.submit(:job,'auto_unseal',sysdate,'sysdate+1/1440');rn commit;rnend;rn[/code]rnrn求各位大侠帮忙看看错在何方、、在网上找了很多就是解决不了。
ora-01008 并非所有变量都已关联的错误,是什么原因呀?
我的程序中,出现java.sql.SQLException: ORA-01008: 并非所有变量都已关联,这是什么原因呀?
小弟新学,ORA-01008: 并非所有变量都已关联 --的问题
ORA-01008: 并非所有变量都已关联rn下面是代码,检查不出,哪个变量没赋值关联啊。小弟新手,谢谢指教。rnrn[code=C#]rnprotected void btChangeProc_Click(object sender, EventArgs e)rn rnrn string CaseId = Request["CaseId"];rn string AptdDept = ddlDeptId.SelectedValue.ToString();rn string AptdUser = ddlProcUser.SelectedValue.ToString();rnrnrn OracleConnection cn = new OracleConnection(OracleHelper.ConnectionStringLocalTransaction); rn OracleCommand cmd = new OracleCommand("UPDATE O_C_CaseRecord set APTDDEPT= :AptdDept, APTDUSER = :AptdUser, STATE = 'null' WHERE CASEID= :CaseId ",cn); rnrn cn.Open(); rn rn //执行命令rn int val = cmd.ExecuteNonQuery();rn cmd.Parameters.Clear();rn //判断是否修改成功rn if (val > 0)rn btChangeProc.Text = "移交成功";rn elsern btChangeProc.Text = "移交失败";rnrn cn.Close(); rn rn rn rnrnrn[/code]rnrnrnrn报错:rn+ $exception "ORA-01008: 并非所有变量都已关联\n" System.Exception System.Data.OracleClient.OracleExceptionrn+ this ASP.memberpages_operm_case_chgcaseproc_aspx MemberPages_OperM_Case_ChgCaseProc ASP.memberpages_operm_case_chgcaseproc_aspxrn+ sender Text = "确认移交" object System.Web.UI.WebControls.Buttonrn+ e System.EventArgs System.EventArgsrn CaseId " 2008121110" stringrn AptdDept "1" stringrn AptdUser "jiangxy" stringrn+ cn System.Data.OracleClient.OracleConnection System.Data.OracleClient.OracleConnectionrn- cmd System.Data.OracleClient.OracleCommand System.Data.OracleClient.OracleCommandrn+ base System.Data.OracleClient.OracleCommand System.Data.Common.DbCommand System.Data.OracleClient.OracleCommandrn CommandText "UPDATE O_C_CaseRecord set APTDDEPT= :AptdDept, APTDUSER = :AptdUser, STATE = '待处理' WHERE CASEID= :CaseId " stringrn CommandTimeout 0 intrn CommandType Text System.Data.CommandTypern+ Connection System.Data.OracleClient.OracleConnection System.Data.OracleClient.OracleConnectionrn DesignTimeVisible true boolrn+ Parameters System.Data.OracleClient.OracleParameterCollection System.Data.OracleClient.OracleParameterCollectionrn+ Transaction null System.Data.OracleClient.OracleTransactionrn UpdatedRowSource Both System.Data.UpdateRowSourcern+ 静态成员 rn+ 非公共成员 rn val 0 intrn
急急 ASP.NET连10G ORA-01008: 并非所有变量都已关联
private const string SQL_SELECT_UNDER = "SELECT CID, FCID,QYQC, QYDM,QYLB, PXH, QYJC, LXR, GDDH, YDDH, BZ,F FROM INF_CompanyInfo WHERE CID=:CID OR FCID=:FCID and F='0' ORDER BY FCID,PXH";rnrnpublic List GetUnderCompanys(string CID)rn rn OleDbParameter[] parm = new OleDbParameter[]rn new OleDbParameter(":CID", OleDbType.VarChar, 5),rn new OleDbParameter(":FCID", OleDbType.VarChar, 5)rn ;rn parm[0].Value = CID;rn parm[1].Value = CID;rn List companys = new List();rn using (OleDbDataReader rdr = OledbHelper.ExecuteReader(OledbHelper.ConnectionStringLocalTransaction, CommandType.Text, SQL_SELECT_UNDER, parm))rn rn while (rdr.Read())rn rn CompanyInfo company = new CompanyInfo(rdr.GetString(0), rdr.GetString(1), rdr.GetString(2), rdr.GetString(3), rdr.GetString(4), rdr.GetInt32(5), rdr.GetString(6), rdr.GetString(7), rdr.GetString(8), rdr.GetString(9), rdr.GetString(10), rdr.GetString(11));rn companys.Add(company);rn rn rn return companys;rn rnrn请问什么原因?
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件