我们如何在oracle中存储过程 [英] How we can store procedure in oracle

查看:71
本文介绍了我们如何在oracle中存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我如何在oracle中调用商店程序?



我的桌子是



please help me how we can call store procedures in oracle?

my table is

Name         Null     Type          
------------ -------- ------------- 
EMPID        NOT NULL NVARCHAR2(15) 
EMPNAME      NOT NULL NVARCHAR2(20) 
DESIGNATION  NOT NULL NVARCHAR2(30) 
SALARY       NOT NULL NUMBER(10)    
CONTACTNO             NUMBER(10)    
DEPARTMENTNO          NUMBER(8)    





我创建了一个程序(通过谷歌的帮助),如下所示





and i have created a procedure (by taking help by google) like as shown below

create or replace procedure add_newEmployee
(
P_EmpId Emp.Empid%type,
P_EmpName Emp.Empname%type,
P_Designation Emp.Designation%type,
P_Salary Emp.Salary%type,
P_ContactNo Emp.Contactno%type,
P_DepartmentNo Emp.Departmentno%type)
as
begin
insert into Emp(EmpId,EmpName,Designation,Salary,ContactNo,DepartmentNo)
values (P_EmpId,P_EmpName,P_Designation,P_Salary,P_ContactNo,P_DepartmentNo);
commit;
end add_newEmployee;





现在我想调用以上商店程序,但我怎么能,我想插入一行或多行。

请帮帮我。



给我OUT和IN参数示例也。请


我尝试了什么:



i希望在oracle中调用存储过程



now i want to call above store procedure but how i can, i want to insert a row or multiple row.
please help me.

give me OUT and IN parameter example also.please

What I have tried:

i want to call store procedure in oracle

推荐答案

这是指向教程的第6步的链接,该教程将向您展示如何调用该过程 Oracle教程 - 执行存储过程 [ ^ ]

第21和22节介绍如何使用IN和OUT参数。



但是我强烈建议你从第1部分开始阅读整个教程(免责声明 - 我与该网站无关)。
Here is a link to step 6 of a tutorial which will show you how to call the procedure Oracle Tutorials - Execute a Stored Procedure[^]
Sections 21 and 22 show you how to use IN and OUT parameters.

However I strongly advise that you start at section 1 and read the entire tutorial (disclaimer - I have nothing to do with that site).


这篇关于我们如何在oracle中存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆