1.建立表
createtable
test
(id
number
,name
varchar2(10
),***
varchar2(4
),age
number
,address
varchar2(200
));
2.建立不帶引數的儲存過程
createorreplace
procedure
proc1
isbegin
insert
into test(id,name,***,age) values
(1,'
moses
','man
',25
);commit
;end
;/
3.寫c#**呼叫這個不帶引數的儲存過程
protectedvoid button2_click(object
sender, eventargs e)
4.寫乙個沒有返回值的帶引數的儲存過程
createorreplace
proc2
(v_id
number
,v_name
varchar2)is
begin
insert
into
test(id,name)
values
(v_id,v_name);
commit
;end
;/
5.c#呼叫這個帶引數無返回值的儲存過程
protectedvoid button1_click(object
sender, eventargs e)
if (string.isnullorempty(this
.textbox3.text))
string or=configurationmanager.connectionstrings["
conn
"].tostring();
oracleconnection oc = new
oracleconnection(or);
oc.open();
oraclecommand om =oc.createcommand();
om.commandtype =commandtype.storedprocedure;
om.commandtext = "
proc2";
om.parameters.add(
"v_id
", oracletype.number).direction =parameterdirection.input;
om.parameters[
"v_id
"].value = this
.textbox2.text.trim();
om.parameters.add(
"v_name
", oracletype.nvarchar).direction =parameterdirection.input;
om.parameters[
"v_name
"].value = this
.textbox3.text.trim();
om.executenonquery();
oc.close();
}
6.寫乙個帶引數有返回值的儲存過程
createorreplace
procedure proc3 (recount out number)is
begin
select
count(*) into reccount from
test;
commit
;end
;/
7.c#呼叫這個帶引數有返回值的儲存過程
protectedvoid button1_click(object
sender, eventargs e)
C 呼叫oracle儲存過程
建立oracle過程儲存 create or replace procedure proce test paramin in varchar2,paramout out varchar2,paraminout in out varchar2 asvarparam varchar2 28 begin ...
c 呼叫oracle儲存過程
create or replace package pkg tabletype is type tabletype is ref cursor procedure sp cpzd cpno in varchar2,status in varchar2,t sql out tabletype end ...
C 呼叫oracle儲存過程
c 呼叫oracle儲存過程 oracle方面 建立oracle過程儲存 create or replace procedure proce test paramin in varchar2,paramout out varchar2,paraminout in out varchar2 asvar...