What is wrong with this procedure:
CREATE OR REPLACE
PROCEDURE add_user (pid IN NUMBER, plogin IN VARCHAR2, ppassword IN VARCHAR, pemail IN VARCHAR)
IS
BEGIN
DECLARE encryptedpassword VARCHAR(255);
SET encryptedpassword := MD5(ppassword);
INSERT INTO account(id, login, password, email)
VALUES (pid, plogin, encryptedpassword, pemail);
END add_user;
For me it's look ok, but I'm getting errors:
Error(6,3): PLS-00103: Encountered the symbol "INSERT" when expecting one of the following: begin function pragma procedure subtype type current cursor delete exists prior The symbol "begin" was substituted for "INSERT" to continue.
Error(8,13): PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ( begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge
My table account looks like this:
CREATE TABLE account
(
id NUMBER(6,0) PRIMARY KEY,
login VARCHAR2(16) NOT NULL,
password VARCHAR(255) NOT NULL,
email VARCHAR(25) NOT NULL,
register_data DATE,
last_seen DATE,
login_failed NUMBER(5,0)
);
Anybody, something?