Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an MD5 Sum function in PL/SQL

Tags:

oracle

md5

md5sum

In Oracle SQL, is there an MD5 function or something available to me? I would like to do something like...

select name, md5_sum( name ) from person;
like image 398
Bob Kuhar Avatar asked Jan 11 '12 21:01

Bob Kuhar


People also ask

How do you sum in PL SQL?

Example - With Single FieldSELECT SUM(salary) AS "Total Salary" FROM employees WHERE salary > 50000; In this SUM function example, we've aliased the SUM(salary) expression as "Total Salary". As a result, "Total Salary" will display as the field name when the result set is returned.

What is MD5 function in Oracle?

An Oracle MD5 function is a hash function which is used to access data integrity. MD5 stands for Message Digest Algorithm 5. MD5 is a cryptographic hash function which is commonly used to calculate checksum of enter value and generating a 128 bit (16 Byte) hash value.

How do you sum a column in Oracle?

Oracle SUM() function syntaxThe Oracle SUM() function is an aggregate function that returns the sum of all or distinct values in a set of values. The Oracle SUM() function accepts a clause which can be either DISTINCT or ALL . The DISTINCT clause forces the SUM() function to calculate the sum of unique values.

What is standard hash in Oracle?

STANDARD_HASH computes a hash value for a given expression using one of several hash algorithms that are defined and standardized by the National Institute of Standards and Technology.


1 Answers

You may want to check the DBMS_OBFUSCATION_TOOLKIT.MD5 procedure.

Here is an example:

     SQL> column md5_val FORMAT A40
     SQL> SELECT DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw('Eddie')) md5_val
       2    FROM DUAL;
     MD5_VAL
     ----------------------------------------
     E5F6C83E6E97C74FC9E9760FC8972AED

     1 row selected.
like image 195
Eddie Awad Avatar answered Oct 13 '22 07:10

Eddie Awad