cancel
Showing results for 
Search instead for 
Did you mean: 

loadProcedure is not a function

thiagofcs
Explorer
0 Kudos
308

Hi,

I'm working with an MTA (multi-target application) within an on-premise HANA XSA with WebIDE. 

In my project I have a db module with a .hdbprocedure artifact and I'm trying to run it from a xsjs module.

In the xsjs module, I created a country.xsjs where I try to run the procedure. The code is like below:

 

var conn = $.hdb.getConnection();
var fnCreateCountry = conn.loadProcedure("TINYWORLD_HDI_TINYDB_1","tinyworld.tinydb::createCountry");
var result = fnCreateCountry();
conn.commit();
conn.close();

 

The problem when I run the country.xsjs I get the error below:

thiagofcs_0-1720039134730.png

It seems that it is not finding the loadProcedure under $.hdb.getConnection...

I`m using HANA 2.0 SPS 07.

I did the exactly tinyworld exercise from the HANA developer guide:
SAP HANA Developer Guide for XS Advanced Model (SAP Web IDE) | SAP Help Portal

Appreciate any help on this.

Best Regards,

Thiago

#WebIDE, #HANA XS Advanced, #XSJS

 

 

 

thiagofcs
Explorer
0 Kudos

Hi all, after some work I could solve this issue. Since I have not seen anything related I`m going to share what happend:

Somehow, whe I created the Node.js / XSJS module, it xsjs uses now this async-xsjs.

thiagofcs_0-1720182268987.png

So, in my .xsjs I had to use an async function and the await to call the loadProcedure, or executeQuery functions.

thiagofcs_1-1720182422715.png

As I`m in a rush I did not have time to stop and try to understand what changed but this was the solution to fix the issue.

View Entire Topic
junwu
Active Contributor
0 Kudos

don't waste time on xsjs.

thiagofcs
Explorer
0 Kudos
How should I proceed. Use pure Node.js without xsjs?
thiagofcs
Explorer
0 Kudos
All uses the xsjs. Even most recent tutorials from SAP
junwu
Active Contributor
0 Kudos
ok, have fun.