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;
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With