⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stored proc.txt

📁 100多M的J2EE培训内容
💻 TXT
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -