Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    6

    Unanswered: Procedure Vs Function

    Need Help, the following procedure/function is supposed to execute a query and return a resultset object to the calling application, however, when i try to create it in oracle i get the errors shown below!


    CREATE OR REPLACE FUNCTION fu_checkAlert
    (
    PID_in IN INTEGER
    )
    RETURN "rs" AS LANGUAGE JAVA NAME 'ResultSet';
    BEGIN
    SELECT * FROM Alert WHERE PID = PID_in ORDER BY alertdate;
    END;
    /
    show err;


    Warning: Function created with compilation errors.

    Errors for FUNCTION FU_CHECKALERT:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    6/1 PLS-00103: Encountered the symbol "SELECT"





    PLEASE HELLLP ME!!!!

  2. #2
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    PL/SQL does not understand the standard select statement. Think about it from PL/SQLs standpoint, where should the data be put?? You need to use a "SELECT INTO" statement. Here is some helpful reading
    http://download-west.oracle.com/docs...ms45.htm#36067
    NOTE: Please disregard the label "Senior Member".

Posting Permissions

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