Skip to Content
0
Former Member
Jun 13, 2014 at 04:39 PM

I can't get the syntax for a table defined function to work.

370 Views

Specifically I'm trying to use a table type definition in my function.

CREATE TYPE "MYSCHEMA"."TT_MYTABLE" AS TABLE (

"Field" varchar(12)

)

CREATE FUNCTION "MYSCHEMA"."MYFUNCTION"()

RETURNS TABLE ("MYSCHEMA"."TT_MYTABLE")

LANGUAGE SQLSCRIPT

...

All the function examples use an actual field definitions and not an predefined table type. I've tried the above and a bunch of other variations but I get a syntax error on all of them.

This is the documentation page;

http://help.sap.com/saphelp_hanaplatform/helpdata/en/20/d42e77751910149f0ff6b879b1290f/content.htm

They don't show any examples using the table types and I can't seem to make sense of " <datatype> ::= <sql_type> | <table_type>".