Create or Replace Procedure User.AddNewUser ( p_UserId Account.UserId%type, p_Name Account.Name%type, p_ErrCode out Number , P_ErrText out varchar2 ) is Begin Insert into Account(UserId,Name) Values(P_UserId,P_Name); Commit;
p_ErrCode := 0; P_ErrText :='成功导入账户信息。'; Exception When others then P_ErrCode := -ABS(sqlcode); P_ErrText :='导入账户信息发生错误(' [解决办法] to_char(p_ErrCode ) [解决办法] ')'; rollback; End AddNewUser; /
然后CB里使用StoredProcedure组件直接调用改存储过程AddNewUser即可, 把UserId,Name按照参数传递就成 不要直接在CB里使用"insert into ....." AdoQuery->ExecSQL();