Skip to Content
1
Apr 18 at 04:29 PM

Pass parameters to stored procedure from javascript

386 Views Last edit Apr 18 at 04:31 PM 2 rev

Hi there!

Can someone tell me how to pass parameters to a stored procedure from javascript

here is my test SP

image.png

this is my .cds code

image.png

this is my js, i want to call test from this function but application not getting deployed

image.png

this.on('test', async () => { try { const a = req.data; let dbQuery = `Call "test"(A => ?)` let result = await cds.run(dbQuery, {a}); console.log(result); return true; } catch (error) { return false } })

Thanks..

Attachments

image.png (32.2 kB)
image.png (7.7 kB)
image.png (44.0 kB)