Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In HANA, a table type can be provided as a parameter in a stored procedure by defining the input parameter with the data type of the table type.

For example, if you have created a table type called "myTableType", you can create a stored procedure that takes this table type as input parameter as follows:

CREATE TYPE myTableType AS TABLE (
  id INT,
  name NVARCHAR(50)
);

CREATE PROCEDURE myProcedure (IN inputTable myTableType)
  LANGUAGE SQLSCRIPT
  AS
  BEGIN
    -- Do something with the inputTable
  END;

In this stored procedure, the input parameter "inputTable" has the data type "myTableType", which is the table type defined earlier. When calling this stored procedure, you can pass a table of that type as a parameter:

DECLARE myTable myTableType;
-- Populate the table
EXECUTE myProcedure(:myTable);