This example shows how to use parameters and declaration of variables in Oracle stored procedures.
CREATE OR REPLACE PROCEDURE ProcedureName
(
prmVarID NUMBER, -- parameters
prmVar2 VARCHAR2
)
IS
vTmpVar2 tableName2.ColName2%TYPE; -- variable will be used in procedure
Begin
Select columnX, columnY
INTO vTmpVar, vTmpVar2
From tableName3
Where tableName3.ID = prmVarID ;
Some code here
INSERT INTO someTable ......................
.........
End;
END ProcedureName;
/
CREATE OR REPLACE PROCEDURE ProcedureName
(
prmVarID NUMBER, -- parameters
prmVar2 VARCHAR2
)
IS
vTmpVar2 tableName2.ColName2%TYPE; -- variable will be used in procedure
Begin
Select columnX, columnY
INTO vTmpVar, vTmpVar2
From tableName3
Where tableName3.ID = prmVarID ;
Some code here
INSERT INTO someTable ......................
.........
End;
END ProcedureName;
/
Yorumlar