stored proc.txt
来自「100多M的J2EE培训内容」· 文本 代码 · 共 19 行
TXT
19 行
Stored Procedures for Auto-Generated Keys
-----------------------------------------
Here we have an example of a stored procedure that will insert a row into the database and return the auto-generated primary key field within the same database call. The primary key is needed to return from ejbCreate, as mandated by the spec. The stored procedure uses an Oracle sequence named accountID to generate primary keys.
InsertAccount stored procedure for Oracle
create or replace procedure insertAccount
(owner IN varchar,
bal IN integer,
newid OUT integer)
AS
BEGIN
insert into accounts (id, ownername, balance)
values (accountID.nextval, owner, bal)
returning id into newid;
END;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?