proce_empcur1.htm
Objective:
  • Creating procedure using php
  • Can same name be shared by a procedure and a cursor ?
  • Hmm ! did not conflict !!
The example below showed how to create a stored procedure. FYI, this procedure did not have  any parameters (IN or OUT), whole procedure was created with a single line string. 
PHP Script:

create or replace procedure emp_cur1
IS
v_empno emp.empno%type;
v_ename emp.ename%type;
v_job emp.job%type;
v_sal emp.sal%type;
cursor emp_cur1 IS
select empno, ename, job, sal
from emp
where job = 'MANAGER';
BEGIN
open emp_cur1;
LOOP
FETCH
emp_cur1
INTO
v_empno, v_ename,v_job,v_sal;
Exit when
emp_cur1%NOTFOUND;
END LOOP;
CLOSE emp_cur1;
end;
/

A screen shots from the server end

Edited

 

Saved in

Edit for dbms output

Reporting the query