我正在尝试设置输出参数 thirdPartyId 的值,但missing or invalid option
在set thirdPartyId
声明中出现错误提示。
PROCEDURE usp_insert_user( userType VARCHAR2,
logonId VARCHAR2,
title VARCHAR2,
firstName VARCHAR2,
middleName VARCHAR2,
lastName VARCHAR2,
comments VARCHAR2,
thirdPartyId OUT number) AS
begin
set thirdPartyId := select max(third_party_id) + 1 from third_party_user_temp;
insert into THIRD_PARTY_USER_TEMP
(Third_party_id,web_logon_id,prsn_type_cd,prsn_title_nm,
prsn_first_nm,prsn_mdl_nm,prsn_last_nm,addtnl_third_party_txt)
VALUES(thirdPartyId,logonId,upper(userType),title,
firstName,middleName,lastName,comments)
;
end usp_insert_user;
这样做的正确方法是什么?
谢谢!
更新:这更安全吗?
insert into THIRD_PARTY_USER_TEMP
(Third_party_id,web_logon_id,prsn_type_cd,prsn_title_nm,
prsn_first_nm,prsn_mdl_nm,prsn_last_nm,addtnl_third_party_txt)
VALUES((select max(third_party_id) + 1 from third_party_user_temp),logonId,upper(userType),title,
firstName,middleName,lastName,comments)
returning third_party_id into thirdPartyId