Procedure [message #666791] |
Sat, 25 November 2017 22:38 |
|
rkapex
Messages: 10 Registered: November 2017
|
Junior Member |
|
|
I created one procedure I execute the below procedure but no ouput showing . Please tell how can I execute the below procedure.
create or replace PROCEDURE OVERLOAD_PROCEDURE
IS
VAR_NUM NUMBER(10);
DEPTNAME VARCHAR2(10);
PROCEDURE OVER_LOAD(DEPTNO NUMBER)
IS
BEGIN
SELECT COUNT(*) INTO VAR_NUM FROM EMPLOYEES WHERE DEPARTMENT_ID=DEPTNO;
SELECT DEPARTMENT_NAME INTO DEPTNAME FROM DEPARTMENTS WHERE DEPARTMENT_ID=DEPTNO;
DBMS_OUTPUT.PUT_LINE('Number of Employees are '||VAR_NUM);
OVER_LOAD(DEPTNAME);
END ;
PROCEDURE OVER_LOAD(DEPTNAME VARCHAR)
IS
BEGIN
SELECT COUNT(*) INTO VAR_NUM FROM DEPARTMENTS WHERE DEPARTMENT_NAME=DEPTNAME;
DBMS_OUTPUT.PUT_LINE('Number of Employees are '||VAR_NUM);
END;
BEGIN
OVER_LOAD(90);
OVER_LOAD('Marketing');
END ;
|
|
|
|
|
Re: Procedure [message #666817 is a reply to message #666796] |
Mon, 27 November 2017 03:25 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
The number one calls the varchar one and the varchar one calls the number one and itself.
So any call to either will result in an infinite loop.
Barbara's rewrite has fixed this.
|
|
|