+ Reply to Thread
Results 1 to 1 of 1

Thread: Urpj2 + function subjects count

  1. #1
    All knowing Bloo_uni's Avatar
    Join Date
    Oct 2010
    Posts
    182

    Uprj2 + function subjects count

    Code:
    CREATE OR REPLACE FUNCTION F_subj(code_semester number)
    RETURN number IS
    code_sub NUMBER
    
    BEGIN
          SELECT count(codesub) INTO code_sub FROM Subjects where Semester=code_semester
          RETURN code_sub;
    END
    ---- Function created.

    Code:
    alter function f_subj compile
    --- Function altered.

    Code:
    select f_subj(5) from dual
    --- Output:

    F_SUBJ(5)
    ----------
    4
    Attached Files
    Last edited by Bloo_uni; 26-11-2012 at 03:46 PM.

+ Reply to Thread

Posting Permissions

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