declare @DeptSales$dept_id2 int declare @DeptSales$checked2 int set @DeptSales$checked2 = 0 set @DeptSales$dept_id2 = 300 select @DeptSales$lv_sales = from departmentsales where id = @DeptSales$dept_id2 AND year = @on_year and checked = @DeptSales$checked2 set @dept_sales = @DeptSales$lv_sales2 RETURN Example 3 The third example illustrates what you should do with overloaded procedures. Oracle create procedure Proc1 is on_year int := 2000; dept_sales int := 0; procedure DeptSales(dept_id int) is lv_sales int; procedure Add is dept_sales := dept_sales + lv_sales; end Add; procedure Add(i int) is dept_sales := dept_sales + i; end Add; begin select sales into lv_sales from departmentsales where id = dept_id and year = on_year; Add; Add(200); end DeptSales; begin DeptSales(100); end Proc1;
declare @DeptSales$dept_id2 int declare @DeptSales$checked2 int set @DeptSales$checked2 = 0 set @DeptSales$dept_id2 = 300 select @DeptSales$lv_sales = from departmentsales where id = @DeptSales$dept_id2 AND year = @on_year and checked = @DeptSales$checked2 set @dept_sales = @DeptSales$lv_sales2 RETURN Example 3 The third example illustrates what you should do with overloaded procedures. Oracle create procedure Proc1 is on_year int := 2000; dept_sales int := 0; procedure DeptSales(dept_id int) is lv_sales int; procedure Add is dept_sales := dept_sales + lv_sales; end Add; procedure Add(i int) is dept_sales := dept_sales + i; end Add; begin select sales into lv_sales from departmentsales where id = dept_id and year = on_year; Add; Add(200); end DeptSales; begin DeptSales(100); end Proc1;
SSMAOracle.docx