Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006
    Posts
    5

    Angry Unanswered: Help How do I write the output parameter...

    ..calling a stored procedure. *results
    package

    I am using the C programming language... I have two input variables and one output...Not sure how to do the output

    BEGIN EQUIPMENT_UTILITIES.MOVE_EQUIPMENT(EQNUM, MoveTo, ?); END;

    This is in a CSTRING format....
    Thanks.
    Sherin

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Here is a dummy example, just to show the principle; procedure accepts department and employee numbers and returns employee's salary:
    Code:
    CREATE OR REPLACE PROCEDURE prc_sal (
       par_deptno   IN       EMP.deptno%TYPE,
       par_empno    IN       EMP.empno%TYPE,
       par_sal      OUT      EMP.sal%TYPE
    )
    IS
    BEGIN
       SELECT e.sal
         INTO par_sal
         FROM EMP e
        WHERE e.empno = par_empno AND e.deptno = par_deptno;
    END;
    /
    You'd call it as follows:
    Code:
    DECLARE
       accept_sal   EMP.sal%TYPE;
    BEGIN
       prc_sal (30, 7499, accept_sal);
       DBMS_OUTPUT.put_line ('His salary is ' || accept_sal);
    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
  •