CREATE TABLE STUDENT (--Creating student tables
ID Number (TEN) PRIMARY key,--primary Key ID
SNAME VARCHAR2 (20),
);
--Create a stored procedure to add a record to a student table
CREATE OR REPLACE PROCEDURE procedure_add
(in_id in Student.id%type,in_sname STUDENT. Sname%type)
As
BEGIN
INSERT into STUDENT VALUES (in_id,in_sname);
Dbms_output. Put_Line (' data added successfully! ‘);
END Procedure_add;
--when the process is called because it is adding data so when you add it, commit commits or the added data cannot be displayed.
--set serverout on before calling
EXECUTE Procedure_add (NULL, ' AA ', 3);--it is important to note that the ID should be preceded by a trigger to automatically grow otherwise the first parameter here cannot be written as null to give a value I've already written the trigger so here's a null value about ID autogrow The previous article has been written to make reference to
I am a stored procedure written in Sqldeveloper, but the process is performed in Sqlplus
Oracle Stored Procedures