在PLSQLdeveloper上面执行下列代码时报错 ORA-01008:并非所有变量都已绑定,新手求解,

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在PLSQLdeveloper上面执行下列代码时报错 ORA-01008:并非所有变量都已绑定,新手求解,相关的知识,希望对你有一定的参考价值。

BEGIN

SELECT base_cost,base_duration,unit_cost,cost_type INTO v_cost FROM cost c JOIN service s ON s.cost_id = c.id AND s.id

= :new.service_id;

IF v_cost.cost_type=2 THEN

SELECT count(*) into v_count FROM month_duration WHERE service_id = :new.service_id AND month_id = TO_CHAR

(:new.logout_time,'yyyymm');

IF v_count>0 THEN

SELECT sofar_duration INTO v_sofar_duration FROM month_duration WHERE service_id = :new.service_id AND month_id =

TO_CHAR(:new.logout_time,'yyyymm');

v_temp_duration:=v_sofar_duration;

v_sofar_duration := v_sofar_duration + :new.duration;

v_duration := v_sofar_duration - v_cost.base_duration*60*60;

IF v_duration > 0 AND v_cost.base_duration*60*60> v_temp_duration THEN

:new.cost := v_cost.unit_cost * v_duration/3600;

ELSIF v_duration > 0 AND v_cost.base_duration*60*60<= v_temp_duration THEN

:new.cost :=v_cost.unit_cost*:new.duration/3600;

END IF;

UPDATE month_duration SET sofar_duration=v_sofar_duration WHERE service_id = :new.service_id AND month_id =

TO_CHAR(:new.logout_time,'yyyymm') ;

ELSE

v_sofar_duration := :new.duration;

INSERT INTO month_duration(service_id,month_id,sofar_duration)

VALUES (:new.service_id,TO_CHAR(:new.logout_time,'yyyymm'),v_sofar_duration);

END IF;

ELSIF v_cost.cost_type=3 THEN

:new.cost :=v_cost.unit_cost*(:new.duration/3600);

END IF;

END;

参考技术A 你倒是说说plsql里是啥错啊,就这么贴一堆代码,谁也没心思看啊,也没个注释说明啥的,也不弄语法高亮设置

以上是关于在PLSQLdeveloper上面执行下列代码时报错 ORA-01008:并非所有变量都已绑定,新手求解,的主要内容,如果未能解决你的问题,请参考以下文章

遭遇ORA-04063

kali Linux在执行driftnet时报错,怎么办?

pl sql developer应用问题

plsqldeveloper中为啥全选就复制了

动态执行表不可访问,或在v$session

各位大神,我在python代码中,执行下面代码中总是报错,请问 如何在pysqlite中 执行下列命令呢?谢谢