I am new to PL/SQL and trying to create a stored procedure with some input parameters that we will be using to generate our reports.
The aim is to be able to generate 100s or rows of data based on the input parameter that the user will input.
I can do it in SQL Server but I am not sure how to go about it in Oracle.
For example:
Create Procedure usp_employees
(@Deptid int not null,
@MaritalStatus varchar(10) null)
As
Begin
Select Firstname, LastName, HireDate, DepartmentName, Marital_Status
From EmployeeTable
Where DeparatmentID = @Deptid
and Marital_Status = @MaritalStatus
End;
And then I execute it like this:
Execute usp_employees 1,'F';
Can someone please point me on how to recreate and execute this using PL/SQL?
Thanks.