The last time I encountered a small problem, I accurately described it as a design defect. Let's first look at the problem,
3. For DEPT and EMP tables, query the results in the following format and arrange the results in descending order of Department numbers and salaries. Process printing]
Department name employee name salary
Create or replace procedure up_getde (v_did number)
As
Cursor mycur is select D. dname as dname, E. ename as ename, E. Sal as Sal
From dept D, EMP E
Where D. deptno = E. deptno
Order by D. deptno, E. Sal DESC;
Begin
For I in mycur Loop
Dbms_output.put_line (I. dname | ''| I. ename |'' | I. Sal );
End loop;
End;
Last Execution Process: exec up_getde (0 );
There is a meaningless parameter v_did, Which is redundant. Today we found a solution ,,
If the function and stored procedure do not have parameters, the function name and stored procedure name should not be followed by an extension number (); otherwise, a compilation error is reported.
While the call always needs to add ()
Select E. Eid, E. uf_getyearsal () from newstaff e where E. eid = 1