存储过程如下:
create or replace procedure sp_harnessboard_syn
is
cursor c1 is select substr(a.vehicleno,2) as vehicleno,b.code ,a.kindid
from epharnessboard a,epkind b where a.kindid = b.oid;
v_vehicleno varchar2(15);
v_kindid number;
v_code varchar2(2);
v_clpp1 varchar2(32);
v_csys varchar2(5);
v_syr varchar2(128);
v_zsxxdz varchar2(128);
v_lxdh varchar2(20);
v_clxh varchar2(32);
v_sfzmhm varchar2(18);
begin
for c_1 in c1 loop
select clpp1,csys,syr,zsxxdz,lxdh,clxh,sfzmhm
into v_clpp1,v_csys,v_syr,v_szxxdz,v_lxdh,v_clxh,v_sfzmhm
from [email protected]
where hphm = c_1.vehicleno and hpzl = c_l.code;
update epharnessboard set clpp1 = v_clpp1,
BODYWORKCOLORID = (select oid from epbodyworkcolor where code = v_csys),
OWNER = v_syr,
ADDRESS = v_szxxdz,
TEL = v_lxdh,
MANUTYPE = v_clxh,
DRIVINGLICENCE = v_sfzmhm
where vehicleno = v_vehicleno and kindid = c_1.kindid;
commit;
end loop;
exception
when others then
commit;
end;Warning: Procedure created with compilation errorsPL/SQL
执行其中的
select clpp1,csys,syr,zsxxdz,lxdh,clxh,sfzmhm
into v_clpp1,v_csys,v_syr,v_szxxdz,v_lxdh,v_clxh,v_sfzmhm
from [email protected]
句,可以查询得出数据来。
存储过程调试中发现好像存储过程中使用此语句存在问题?为什么 ?????
请教高人。 先谢谢了。
create or replace procedure sp_harnessboard_syn
is
cursor c1 is select substr(a.vehicleno,2) as vehicleno,b.code ,a.kindid
from epharnessboard a,epkind b where a.kindid = b.oid;
v_vehicleno varchar2(15);
v_kindid number;
v_code varchar2(2);
v_clpp1 varchar2(32);
v_csys varchar2(5);
v_syr varchar2(128);
v_zsxxdz varchar2(128);
v_lxdh varchar2(20);
v_clxh varchar2(32);
v_sfzmhm varchar2(18);
begin
for c_1 in c1 loop
select clpp1,csys,syr,zsxxdz,lxdh,clxh,sfzmhm
into v_clpp1,v_csys,v_syr,v_szxxdz,v_lxdh,v_clxh,v_sfzmhm
from [email protected]
where hphm = c_1.vehicleno and hpzl = c_l.code;
update epharnessboard set clpp1 = v_clpp1,
BODYWORKCOLORID = (select oid from epbodyworkcolor where code = v_csys),
OWNER = v_syr,
ADDRESS = v_szxxdz,
TEL = v_lxdh,
MANUTYPE = v_clxh,
DRIVINGLICENCE = v_sfzmhm
where vehicleno = v_vehicleno and kindid = c_1.kindid;
commit;
end loop;
exception
when others then
commit;
end;Warning: Procedure created with compilation errorsPL/SQL
执行其中的
select clpp1,csys,syr,zsxxdz,lxdh,clxh,sfzmhm
into v_clpp1,v_csys,v_syr,v_szxxdz,v_lxdh,v_clxh,v_sfzmhm
from [email protected]
句,可以查询得出数据来。
存储过程调试中发现好像存储过程中使用此语句存在问题?为什么 ?????
请教高人。 先谢谢了。
解决方案 »
- 64位 win7 下,安装oracle 10.2.0问题。
- 因为之前的描述不清楚,重新发帖求助SQL。。。
- ORA-12514 tns:无法解析指定的连接标识符
- 100分求解!!!关于oracle存储过程rollback的处理
- 一个非常奇怪的存储过程出错:Error: PLS-00103:出现符号 "("在需要下列之一时
- 外键的使用
- 查找vchar2类型字段包含某个字符串的sql怎么写啊?
- 小弟要对容量估算,请问每个date、 number(2)分别占多少字节??
- exp的错误,这是什么原因
- oracle9i少了个文件!!(保证结贴)
- 问一下DB-LINK、高级复制的优缺点
- Oracle的控制文件备份出来之后该如何使用它恢复呢?SCN都不一致了。。
SUBSTR('Message',1,4)而不是substr(a.vehicleno,2)
截取a.vehicleno,去掉第1位
select clpp1,csys,syr,zsxxdz,lxdh,clxh,sfzmhm
from [email protected]
还是
select clpp1,csys,syr,zsxxdz,lxdh,clxh,sfzmhm
into v_clpp1,v_csys,v_syr,v_szxxdz,v_lxdh,v_clxh,v_sfzmhm
from [email protected] ?如果执行的是select clpp1,csys,syr,zsxxdz,lxdh,clxh,sfzmhm
from [email protected]
有可能是数据类型有问题
into v_clpp1,v_csys,v_syr,v_szxxdz,v_lxdh,v_clxh,v_sfzmhm
from [email protected]
where hphm = c_1.vehicleno and hpzl = c_l.code;
有问题的话,看下ora错误码是什么,可能游标的一个返回值作为查询条件时返回了多个结果