A simple example of how an oracle who has not contacted Oracle for a project in the company is prepared to use the Proc implementation additions and deletions:
CREATE TABLE T1
(
SID number NOT NULL primary key,
Sname VARCHAR2 (10)
)
Tablespace test;
Declare
A number: = 1;
Begin
Loop
INSERT into T1 values (A, ' snow ');
a:=a+1;
Exit when a=100;
End Loop;
End
----1.insert
Create or replace procedure Proc_insert
(
Sid number,
Sname VARCHAR2
)
Is
Begin
Insert into SCOTT.T1 (sid,sname) values (sid,sname);
Dbms_output.put_line (' Number of rows affected: ' | | Sql%rowcount);
Commit
End
;
Set Serveroutput on
exec proc_insert (' snow ');
----2.update
Create or replace procedure Proc_update
(
Isid in number,
Nsname in VARCHAR2
)
Is
Begin
Update scott.t1 set sname=nsname where Sid=isid;
If Sql%found Then
Dbms_output. Put_Line (' Update successful! ');
Else
Dbms_output. Put_Line (' Update failed! ');
End If;
Commit
End
;