Stored Procedures
Stored Procedures
AS
BEGIN
DBMS_OUTPUT.PUT_LINE('A:'||A);
END P1;
/
DECLARE
BEGIN
P1(100);
END;
/
DECLARE X
NUMBER;
BEGIN
X:=10;
DBMS_OUTPUT.PUT_LINE('X:'||X);
P2(X);
DBMS_OUTPUT.PUT_LINE('X:'||X);
END;
/
DECLARE X
NUMBER;
BEGIN
X:=50;
DBMS_OUTPUT.PUT_LINE('X:'||X);
P3(X);
DBMS_OUTPUT.PUT_LINE('X:'||X);
END;
/
sub program or procedure: to store the procedure inside the database is called
stored procedure.
for the reuse purpose once created you can call the procedures again and again as
per your requirement.
second thing procedures are always return a values with the help of parameters only
means with the
help of out or in out parameter but functions are returning a value with the help
of return keyword and a
return variable.
a procedure is a named pl/sql block that can accept parameters can be invoked.