In Teradata 17, I am trying to call their own hash_md5 external function from my own SQL stored procedure:

replace procedure p()
sql security creator
  declare l_hash varchar(32);
  set l_hash = hash_md5('abc');

call p();

I get:

Failed [3706 : 42000] P:Syntax error: expected something between '(' and the string 'abc'.

I can call this function successfully in plain SQL:

select hash_md5('abc');


I tried to pass a parameter in, instead of a hardcoded literal, but it made no difference.

enter image description here

1 Answer 1


hash_md5 is a C-UDF, which must be installed. Without qualified object name it will only be found if it's created in TD_SYSFNLIB or SYSLIB or the current session default database.

This should work:

set l_hash = mydb.hash_md5('abc');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.