PLS-00103 found 'string' but expected one of the following: 'string'"}, Cause This error message is from the parser. It found a token (language element) that is inappropriate in this context.
Action Check previous tokens as well as the one given in the error message. The line and column numbers given in the error message refer to the end of the faulty language construct.
Action Check previous tokens as well as the one given in the error message. The line and column numbers given in the error message refer to the end of the faulty language construct.
INSERT INTO res_insert_bearing_history
( roll_id, chock_id, plain_bear_id, axial_bear_id,
bush_bear_id, cone_bear_id, quadrant, mounting_date,set_no )
(select new_above_working_roll_id, new_chock_id1,
new_bear_id1 ,null ,null ,null ,quadrant,sysdate , new_set_no
from res_bearing where res_chock.plain_bear_id=res_bearing.bearing_id )
-- 1 record 上工作辊驱动侧:径向轴承
INSERT INTO res_insert_bearing_history
( roll_id, chock_id, plain_bear_id, axial_bear_id,
bush_bear_id, cone_bear_id, quadrant, mounting_date,set_no )
VALUES
( new_above_working_roll_id, new_chock_id1,
new_bear_id1 , '' , '' , '' ,
'A' , sysdate , new_set_no ); -- 1 用下面查询结果替换 'A'/* test INSERT INTO res_insert_bearing_history
( roll_id, chock_id, plain_bear_id, axial_bear_id,
bush_bear_id, cone_bear_id, quadrant, mounting_date,set_no )
VALUES
( new_above_working_roll_id, new_chock_id1,
new_bear_id1 , '' , '' , '' ,
( select quadrant from res_bearing where -- 替换1时出错如题 res_chock.plain_bear_id=res_bearing.bearing_id )
, sysdate , new_set_no ); over */
new_bear_id1 --这些数据从哪里拿出来?
(
new_set_no IN NUMBER, -- 辊组号
new_stand_no IN NUMBER, -- 机架号
new_above_working_roll_id IN VARCHAR2, -- 上辊ID号
new_lower_working_roll_id IN VARCHAR2, -- 下辊ID号
new_above_dia_act IN NUMBER, -- 上辊直径
new_lower_dia_act IN NUMBER, -- 下辊直径
new_chock_id1 IN VARCHAR2, -- 轴承座ID号(上辊)//驱动侧
new_chock_id2 IN VARCHAR2, -- 轴承座ID号(上辊)//操作侧
new_chock_id3 IN VARCHAR2, -- 轴承座ID号(下辊)//驱动侧
new_chock_id4
...
}
从新修改为如下:
-- test INSERT INTO res_insert_bearing_history
( roll_id, chock_id, plain_bear_id, axial_bear_id,
bush_bear_id, cone_bear_id, quadrant, mounting_date,set_no )
VALUES
( new_above_working_roll_id, new_chock_id1,
new_bear_id1 , '' , '' , '' ,
( SELECT quadrant From res_bearing WHERE bearing_id = new_bear_id1 )
, sysdate , new_set_no );-- over
-- new_bear_id1 入参
错误如下:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count c
Help??
( roll_id, chock_id, plain_bear_id, axial_bear_id,
bush_bear_id, cone_bear_id, quadrant, mounting_date,set_no )
select new_above_working_roll_id, new_chock_id1,new_bear_id1,null,null,null,( SELECT quadrant From res_bearing WHERE bearing_id = new_bear_id1 ),sysdate,new_set_no from roll_set_in_stand_proc
SELECT quadrant From res_bearing WHERE bearing_id = new_bear_id1
只有一条记录返回.
我的 bearing_id 是主键!能保证只有一条记录返回.
一般这样的错误都是因为返回值不唯一导致的!
...
new_quadrant1 res_bearing.quadrant%TYPE;
...
SELECT quadrant INTO new_quadrant1 FROM res_bearing WHERE bearing_id = new_bear_id1; INSERT INTO res_insert_bearing_history
( roll_id, chock_id, plain_bear_id, axial_bear_id,
bush_bear_id, cone_bear_id, quadrant, mounting_date,set_no )
VALUES
( new_above_working_roll_id, new_chock_id1,
new_bear_id1 , '' , '' , '' ,
new_quadrant1 , sysdate , new_set_no );
HELP!!!
虽然它是全表查询,但是,他应该可以解决你现在的问题哟
不过,这个命令我也用的不怎么好,你可以去查查书吧!:)