Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL procedure, hashing password with MD5

df22505e-fe12-465e-ac79-6d08f6a3806cMay 31 2016 — edited May 31 2016

Hello everyone!

I'm writting a simple procedure that is adding user to database and I have some problems. My table and procedure 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)

);

And procedure:

CREATE PROCEDURE add_user (pid IN NUMBER, plogin IN VARCHAR2, ppassword IN VARCHAR, pemail IN VARCHAR)

IS

  encryptedpassword VARCHAR(255);

BEGIN

  encryptedpassword := MD5(ppassword);

  INSERT INTO account(id, login, password, email)

  VALUES (pid, plogin, encryptedpassword, pemail);

END add_user;

After compilation I've got these errors:

  • Error(5,3): PL/SQL: Statement ignored
  • Error(5,24): PLS-00201: identifier 'MD5' must be declared

What is wrong with this code?
And yes, I know that md5 is bad and now nobody should use it, but this is only for me.

This post has been answered by Paulzip on May 31 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2016
Added on May 31 2016
6 comments
2,070 views