2013-07-31 74 views
0

這是程序:這個SQL存儲過程爲什麼不起作用?

create or replace 
PROCEDURE INSERTUSER(
     username IN USERS.USERNAME%TYPE, 
    password IN USERS.PASSWORD%TYPE, 
     firstname IN USERS.FIRSTNAME%TYPE, 
     lastname IN USERS.LASTNAME%TYPE, 
    role IN USERS.ROLE%TYPE, 
    banstatus IN USERS.BANSTATUS%TYPE, 
    verifystatus IN USERS.VERIFYSTATUS%TYPE) 
AS 
BEGIN 

    INSERT INTO USERS ("USERNAME", "PASSWORD", "FIRSTNAME", "LASTNAME", "ROLE", "BANSTATUS", "VERIFYSTATUS") 
    VALUES (username, password, firstname, lastname, role, banstatus, verifystatus); 

    COMMIT; 

END; 

,當我嘗試調用它在OracleSQL:

call INSERTUSER(Dean, pass1, Bob, Smith, Admin, 0, 1) 

我得到的錯誤信息:

Error starting at line 1 in command: 
call INSERTUSER(Dean, pass1, Bob, Smith, Admin, 0, 1) 
Error report: 
SQL Error: ORA-06576: not a valid function or procedure name 
06576. 00000 - "not a valid function or procedure name" 
*Cause: Could not find a function (if an INTO clause was present) or 
      a procedure (if the statement did not have an INTO clause) to 
      call. 
*Action: Change the statement to invoke a function or procedure 

你們可以發現任何明顯錯誤/問題?我真的不知道我收到此錯誤信息..

+0

發現問題! 調用該函數時必須使用單引號而不是雙引號! – DeaIss

回答

1

你可以叫你的程序是這樣的:

begin 
    INSERTUSER('Dean', 'pass1', 'Bob', 'Smith', 'Admin', 0, 1); 
end; 
0

發現的問題!調用函數時必須使用單引號而不是雙引號!