Apache Hive : HPL/SQL - CALL Statement

Last updated: August 12, 2026

Apache Hive : HPL/SQL - CALL Statement

CALL statement allows you to execute a stored procedure.

Syntax:

CALL procedure_name [(parameter, ...)]; 

Example:

Define a procedure and then call passing a parameter:

CREATE PROCEDURE set_message(IN name STRING, OUT result STRING)
BEGIN
 SET result = 'Hello, ' || name || '!';
END;

-- Now call the procedure and print the results
DECLARE str STRING;
CALL set_message('world', str);
PRINT str;

Result:
--
Hello, world!

Compatibility: Teradata, IBM DB2 and MySQL

See also: