Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    42

    Unanswered: Return type is Cursor

    Hi guys,

    How do we return the cursor type values. Here iam giving all information about this. because iam new to this oracle concept.

    I had the following details with me

    Input data is p_empno number
    output data is empdetail cursor

    table is emp

    details are empno, empname,sal,address etc

    can you send how to do this one

    kiran

  2. #2
    Join Date
    Dec 2003
    Posts
    74
    Input data is p_empno number
    output data is empdetail cursor

    table is emp

    details are empno, empname,sal,address etc


    declare
    cursor c_emp is
    -- Put your select statement here
    select
    empno,
    empname,
    sal
    from
    emp
    where empno = p_empno;


    BEGIN

    FOR r_emp IN c_emp
    LOOP
    --DO WHAT YOU WILL WITH YOU DATA RETURNED FROM YOUR CURSOR HERE
    E.G.
    v_empno := r_emp.empno;
    v_empname := r_emp.empname;
    v_sal:= r_emp.sal;

    EXIT WHEN c_emp%NOTFOUND;
    END LOOP;
    END;

  3. #3
    Join Date
    Dec 2003
    Posts
    42

    cursor

    Thank you very much

    Originally posted by edwinjames
    Input data is p_empno number
    output data is empdetail cursor

    table is emp

    details are empno, empname,sal,address etc


    declare
    cursor c_emp is
    -- Put your select statement here
    select
    empno,
    empname,
    sal
    from
    emp
    where empno = p_empno;


    BEGIN

    FOR r_emp IN c_emp
    LOOP
    --DO WHAT YOU WILL WITH YOU DATA RETURNED FROM YOUR CURSOR HERE
    E.G.
    v_empno := r_emp.empno;
    v_empname := r_emp.empname;
    v_sal:= r_emp.sal;

    EXIT WHEN c_emp%NOTFOUND;
    END LOOP;
    END;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •