2013-03-27 149 views
1
--Below is for testing only - to be deleted later 
CREATE OR REPLACE PROCEDURE movie_rental_sp 
    (movieIdCount IN OUT NUMBER, 
    movieID IN OUT NUMBER) 
IS 
noMovie EXCEPTION; 
BEGIN 
SELECT MOVIE_ID, count(movie_id) 
    INTO movieIdCount 
    FROM MM_MOVIE 
    WHERE MOVIE_ID = movieID; 
IF movieIdCount = 0 THEN 
RAISE noMovie; 
END IF; 


EXCEPTION 
    WHEN noMovie THEN 
    DBMS_OUTPUT.PUT_LINE('No movies found'); 
END; 
/

警告:使用編譯錯誤創建的過程。PL/SQL語句被忽略&值不足

SQL>顯示錯誤 誤差的程序MOVIE_RENTAL_SP:

LINE/COL ERROR


7/1 PL/SQL:SQL語句忽略 9/2 PL/SQL:ORA-00947 :沒有足夠的值

回答

0

您的SELECT有2列,但您的INTO只有1個變量。

0

更改SELECT語句,

SELECT MOVIE_ID, count(movie_id) 
INTO movieID , movieIdCount 
.....