on 2022 Feb 19 10:49 AM
Hello experts,
I try to call a store procedure with table parameters in a cap SaaS multitenant app, which uses the service manager to manage the HANA containers. I would like to call the procedure with @sap/hdbext to have the benefit of easy use of table parameters.
In https://developers.sap.com/tutorials/hana-cloud-cap-stored-proc.html Thomas Jung describes the call of a stored procedure in a cap cds service implementation in a single tenant environment:
const cds = require('@sap/cds')
module.exports = cds.service.impl(function () {
this.on('sleep', async () => {
try {
const db = await cds.connect.to('db')
const dbClass = require("sap-hdbext-promisfied")
let dbConn = new dbClass(await dbClass.createConnection(db.options.credentials))
const hdbext = require("@sap/hdbext")
const sp = await dbConn.loadProcedurePromisified(hdbext, null, 'sleep')
const output = await dbConn.callProcedurePromisified(sp, [])
console.log(output.results)
return true
} catch (error) {
console.error(error)
return false
}
})
})
In the multitenant app I do not now how to get necessary options for createConnection from the service manager.
Do somebody know how to integrate @sap/hdbext with the service manager in a multitenant app?
Are the HANA config/credential options of the tenants HANA container available in cds.tx(req) ?
Thanks
Achim
I have created my own GLOBAL TEMPORARY COLUMN TABLE in HANA and fill the data into the temporary table before calling the procedure by cds.run (`CALL <procedureName>()',[]);
I do no longer use @sap/hdbext.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.