Skip to Content

How to call a SQL procedure with custom CDS Structured Type in an HDI container?

Hello,

For an MTA targeted for SAP Cloud Foundry, we are creating SQL procedures. We would like to use CDS Structured Type Definition to define custom structured types. We can successfully build the hdbcds files to create the structure types but the procedures are not getting built. The error that we are getting is:

(HDB) Error: com.sap.hana.di.procedure: Database error 411: : invalid table type: table type does not exist "MY_SCHEMA_NAME"."opensap.common::interface.guids" [8201003]

Here are the details:

db/src/cfg/interface.hdbcds

namespace opensap.common;

context interface {
    type guid : String(36);
    
    type guids {
        id : guid;
    };
}

db/src/procedures/getInterfaces.hdbprocedure

PROCEDURE "getInterfaces"(
    IN aGuid "opensap.common::interface.guids"
)
   LANGUAGE SQLSCRIPT
   SQL SECURITY INVOKER
   READS SQL DATA AS

BEGIN 

   SELECT * 
    FROM interfaces;
   
END

Any guidance would be very much appreciated.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 01, 2019 at 02:16 PM

    As mentioned in a previously asked question by Thomas Jung, need to specify the type explicitly as a table. Updated hdbcds looks like

    namespace opensap.common;
    
    context interface {
        type guid : String(36);
        
        table type guids {
            id : guid;
        };
    }

    PS - Stumbled on the answer after posting the question ;)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.