Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
zahid.sabreen
Starting Member
14 Posts |
Posted - 2011-01-31 : 03:24:53
|
| CREATE OR REPLACE PACKAGE GetEmpPckg IS-- Strongly Typed REF CURSOR-- A REF CURSOR that specifies a specific return typeTYPE emp_ref_cursor IS REF CURSOR RETURN emp%ROWTYPE;---- Weakly Typed-- A REF CURSOR that does not specify the return type such as SYS_REFCURSOR-- TYPE emp_ref_cursor IS REF CURSOR;PROCEDURE GetEmp (p_dep IN emp.deptno%TYPE, p_ref OUT emp_ref_cursor);END GetEmpPckg;/Please help convert following code to t sqlCREATE OR REPLACE PACKAGE BODY GetEmpPckg ISPROCEDURE GetEmp (p_dep IN emp.deptno%TYPE, p_ref OUT emp_ref_cursor) IS BEGIN OPEN p_ref FOR SELECT empno, ename, job, mgr, hiredate, sal, comm, deptno FROM emp WHERE deptno = p_dep ORDER BY ename; END;END GetEmpPckg; |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-01 : 05:08:16
|
| SQL Server does not support package and ref cursor. You can simply usecreate procedure GetEmp(@p_dep varchar(10))asSELECT empno, ename, job, mgr, hiredate, sal, comm, deptnoFROM empWHERE deptno = @p_depORDER BY enameMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|