Skip to Content

HANA 2.0 - Create table from Node.js module with hdbext

Hello everyone,
I am experiencing the most common error but I am not able to understand why I am falling into that.
Maybe I am missing a very simple point, but here's the scenario:

I have a Node.js module running in an HANA 2.0SPS01 application which is connecting to an external - non HANA - OData Service, loads the metadata for specific entities and tries to create table(s) on the fly which reflect the structure of the requested entities.

After that, it loads data from the service and stores fetched data inside table(s) created in step 1.

For that, I am using the "normal" sap-hdbext standard module providing DDL statements to create the tables I need.
Notice that I am using the hdb-ext middleware, to have the hdb module injected and available to each request.

        // Setup HDB Client:
            hana: process.env.HANA_SERVICE_NAME || {
                tag: "hana"

However, everytime I invoke the db.exec() method by providing the DDL statement (which is something like CREATE TABLE "<Context>.<TableName>" (<Columns>)...) I always receive a "Insufficient privileges: Unauthorized" error.

The schema name is not specified, as it's determination is part of the hdb-ext module loading, as well as the connection to the database which is automatically created by the module using the HDI container technical user.

What could be the reason of the authorization issue? The client is perfectly able to execute DML statements, but no DDL ones.

Is there something I am missing/forgetting while working with HDI containers?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jul 12, 2017 at 12:10 AM

    Hello Roberto:

    I wonder if you need to add a create table privilege to your hdbrole. Step 9 of this tutorial,, might be of help.



    Add comment
    10|10000 characters needed characters exceeded